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. Open WeChat Pay 1.1 Affiliat...
Menu bar example 1: Copy code The code is as foll...
Table of contents BOM (Browser Object Model) 1. W...
1. Problem Description root@mysqldb 22:12: [xucl]...
Table of contents Parsing .vue files Extract docu...
Table of contents The origin of JSBridge The bidi...
This article shares the specific code for the WeC...
This article shares the specific code of jQuery t...
In the process of learning CSS3, I found that man...
1. Install Docker 1. I installed Centos7 in the v...
Linux often encounters situations such as adding ...
Flex Layout Flex is the abbreviation of Flexible ...
Preface Project release always requires packaging...
Note: I use Centos to install docker Step 1: Inst...
environment System: Ubuntu 18.04 Software: qt5.12...