Significance
It enables the fastest installation and deployment of a Linux OS. Installation is quick and easy, and you can start running Docker almost immediately. It runs very fast and uses a RAM disk.
My situation
Win8 laptop occasionally used for gaming, but installing a Linux dual boot might take me a day to complete. All my work just needs to run in Docker. And my laptop has enough memory: 16G (thanks to Teacher Jiang at HUST).

Preparation
- CoreOS image Download link
- EasyBCD Download link
Getting Started
- Install EasyBCD, add an ISO boot entry, and directly use CoreOS's LiveCD image.
Detailed steps with screenshots:http://jingyan.baidu.com/article/466506586ed309f549e5f81c.html - Boot CoreOS and complete the CoreOS installation.
Update
Simply update the ISO file used for booting.
Disadvantages
- No persistence (the resulting advantage: if it breaks, simply reboot).
- The entire OS generates files on the disk, directly occupying disk space (the advantage this brings: disk speed is greatly improved).
- Every time you boot, you must manually mount the hard disk space and manually run the entire system's initialization script.
Combining the advantages and disadvantages, this configuration is recommended for work with specific, fixed tasks. If you have more tasks, there may be more things to optimize.
Configuration
- Create a 100G space on the hard disk, format it. Reference command: mkfs.ext4 /dev/sda2, then mount it. If you don't understand how to partition, format, and mount, please refer tohere. This article is arguably the best one I've seen on basic disk management.
- After mounting, copy the folder /var/lib/docker/ to the mounted location, then symlink it back. (Then docker images can be persisted to the hard disk and won't be lost after reboot.) Reference operations are as follows:
cp -rf /var/lib/docker /mnt/ rm -rf /var/lib/docker ln -s /mnt/docker /var/lib/docker
My initialization file reference
mkdir /root/.ssh echo "ssh-rsa xxx..(省略)....xx Li-jianying@lijianyings-MacBook-Pro.local" > /root/.ssh/authorized_keys rm -rf /var/lib/docker ln -s /mnt/docker /var/lib/docker #echo 'DOCKER_OPTS="--registry-mirror=http://XXXXX.m.daocloud.io"' >> /run/flannel_docker_opts.env #systemctl daemon-reload systemctl restart docker # using disk
First import the RSA key, then symlink it to the Docker location.
Add daocloud acceleration (although the official documentation doesn't mention how to accelerate CoreOS, a guru provided a method). Since I find not using acceleration is faster than using it, I commented it out here as a backup option.
systemd pitfalls
If Docker returns error -1, the container will crash. However, the scope still exists in systemd.
When starting the problem container, it prompts:
Error response from daemon: Cannot start container test: [8] System error: Unit docker-e10eb86807cd9971fc03a8eee732771193d506ed2ba678fdf4292916a9fb072c.scope already exists.
Then
systemctl stop docker-e10eb86807cd9971fc03a8eee732771193d506ed2ba678fdf4292916a9fb072c.scope
you can fix it.
CoreOS.iso pitfall #2
Keeps verifying KnowHosts.
Reference solutionhttps://github.com/lijianying10/FixLinux/blob/master/note/CancelsshPublicKeyKnowHostauthentication.md
Summary
Using this method to deploy Linux on a PC is really convenient. If you're familiar with the Docker approach, you can get it done in about 20 minutes according to your situation.
After I came up with this idea, I weighed various trade-offs.
- To quickly solve the boot problem, use EasyBCD to directly boot the in-memory ISO, instead of dealing with UEFI Grub issues.
- To reduce the time cost of environment configuration, switch from an ordinary distribution installed on the hard drive to CoreOS.
- To avoid system instability caused by wrong operations or version upgrades, switch to Docker.
- In the future, maybe switch to RKT, RunC (hope the experts will fill the gaps soon; RunC said it would release this month, not sure if it will be delayed).
- Note that this approach uses the simplest environment configuration at all costs in exchange for development time. Perfectionists who enjoy tinkering should probably look elsewhere.
Source: http://www.philo.top/2015/07/16/pc-docker/