Quick Start of CoreOS installation on PC
Meaning
Able to install and deploy the Linux operating system as quickly as possible. The installation is fast and simple, and Docker can be started in almost no time. The running speed is very fast. Use a memory hard disk.
My situation
Win8 laptops occasionally play games, but it may take one day for me to install a Linux system. All my businesses only need to run in Docker. In addition, my laptop has 16 GB of memory (thanks to teacher HUST Jiang ).
Preparation
- CoreOS image
- EasyBCD 2.2 free download [Chinese multi-language edition]
Commencement
- Install EasyBCD and add the ISO boot item file directly using the livecd image of CoreOS
Detailed steps include:
- Start CoreOS to complete CoreOS Installation
Update
You only need to update the ISO file for startup.
Disadvantages
- It cannot be persistent (the advantage is that it can be restarted directly)
- Files generated by the entire operating system in the hard disk directly occupy the hard disk space (the advantage is that the hard disk speed is greatly improved)
- Manually mount the hard disk space at startup and manually run the initialization script of the entire system.
In combination with the advantages and disadvantages, we recommend that you configure this set of configurations to work with specific businesses. If there are many businesses, there may be a lot of optimization points.
Configuration
- Open a GB space on the hard disk and format it. Refer to the command:
mkfs.ext4 /dev/sda2, And then mount. If you do not understand how to partition, format, and mount the partition, see here. This article is the best article I have ever seen about basic disk management.
- Copy the folder after mounting
/var/lib/docker/To the Mount location, and then soft connection back. (Then docker images can be persistently stored in the hard disk and restarted without loss ). Follow these steps:
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... (Omitted)... xx [email protected]">/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
Import rsakey first, and then connect to the docker location.
Add daocloud acceleration (although the official website did not write about how CoreOS is accelerated, but some experts have provided a method), because I do not accelerate faster than acceleration, so I will comment out it first. As an alternative.
Pitfalls encountered by systemd
If error-1 is returned in docker, the container fails. However, scope still exists in systemd.
When the problem container is started, a prompt is displayed.
Error response from daemon:Cannot start container test:[8]System error:Unit docker-e10eb86807cd9971fc03a8eee732771193d506ed2ba678fdf4292916a9fb072c.scope already exists.
So
systemctl stop docker-e10eb86807cd9971fc03a8eee732771193d506ed2ba678fdf4292916a9fb072c.scope
You can do this.
CoreOS. iso pitfall 2
Confirm KnowHosts continuously.
Refer to Solution
Summary
It is too convenient to deploy Linux in a PC using this method. The idea of getting familiar with Docker may take 20 minutes to complete.
After finding this idea, I have gone through various trade-offs.
- To quickly solve the boot problem, use EasyBCD to directly boot the memory ISO for the UEFI Grub problem.
- To reduce the time cost caused by the configuration environment, change the hairstyle version from normal installation to the hard disk to CoreOS
- To avoid the system instability caused by incorrect operations Or version upgrades, change Docker
- In the future, we may change to RKT and RunC. (we hope that the big guys can fill in the issue quickly. RunC said that this month's Release does not know if it will jump)
- Note that this solution uses the simplest environment configuration to change the development time at any cost. Perfectionists may have to make a detour.
How to deploy a WordPress instance in CoreOS
Initial server operating system CoreOS experience
CoreOS practice: Analyzing etcd
CoreOS practice: Introduction to CoreOS and management tools
[Tutorial] Build your first application on CoreOS
CoreOS details: click here
CoreOS: click here
This article permanently updates the link address: