tar backup system sudo tar cvpzf backup.tgz --exclude=/proc --exclude=/mnt --exclude=/sys --exclude=/backup.tgz / For more Linux backup methods, refer to https://www.jb51.net/article/151167.htm Writing dockerfile Create a new directory Dockerfile and edit the Dockerfile script in the Dockerfile directory to the following content: FROM scratch COPY rootfs / RUN chmod u+s /usr/bin/sudo RUN chmod u+s /usr/bin/passwd RUN chmod u+s /bin/su RUN chmod u+s /bin/ping RUN chmod u+s /bin/mount RUN chmod u+s /bin/umount USER root WORKDIR /home/root Change username and password as needed Import the backed up system files as a docker image 1. Create a new directory backup in the Dockerfile directory 2. Unzip the backed up tar file to the backup directory: tar xvpfz backup.tgz 3.sudo docker build -t centos/centos:7.0 . Summarize The above is a detailed explanation of the docker command to back up the Linux system. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: In-depth understanding of javascript class array
>>: Linux/Mac MySQL forgotten password command line method to change the password
Table of contents 1. What is Docker Compose? 2. D...
Question: After the computer restarts, the mysql ...
The Docker Hub we used earlier is provided by Doc...
This article is welcome to be shared and aggregat...
1. Vector Map Vector graphics use straight lines ...
Tab selection cards are used very frequently on r...
1 MySQL autocommit settings MySQL automatically c...
Table of contents Skeleton screen use Vue archite...
MySQL is a relatively easy-to-use relational data...
This article mainly introduces the solution to th...
Table of contents Basic Overview Enable GTID onli...
Use MySQL proxies_priv (simulated role) to implem...
Use the system crontab to execute backup files re...
This article example shares the specific code for...
Table of contents Background of this series Overv...