Sometimes you need to install certain dependencies in the base image. If you write the commands in the Dockerfile, some dependent software will download very slowly, and it will take a long time to build the image. So it is best to install a new image that contains the dependent libraries. Docker provides commit to achieve For example, I have a python image, which is relatively streamlined. The two dependencies freetds-dev and unixodbc-dev are missing. 1. Run the image first docker run -it --name python docker.io/python:3.6.4 /bin/bash /bin/bash enters the container to interact 2. Execute the installation command root@39eaa5aa7332:/code# apt-get install freetds-dev Reading package lists... Done Building dependency tree Reading state information... Done root@39eaa5aa7332:/code# apt-get install unixodbc-dev Reading package lists... Done Building dependency tree Reading state information... Done After the installation is complete, press ctrl+p+q to exit the container. 3. Package the container into an image and execute docker commit [root@CentOS ~]# docker commit 39eaa5aa7332 python3.6.4-dev sha256:ca46b1ed99abc1338881a55a043ee9670a66601530b3f2e63f41eb949b91e84d Then execute docker images to see this image The above is a detailed explanation of the use of Docker commit. For more information about the use of Docker commit, please pay attention to other related articles on 123WORDPRESS.COM! You may also be interested in:
|
>>: Let's talk about the Vue life cycle in detail
Preface Sometimes file copies amount to a huge wa...
Focus images are a way of presenting content that ...
I just happened to encounter this small requireme...
1. Create a shell script vim backupdb.sh Create t...
Problem: When using JDBC to connect to the MySQL ...
Table of contents Web Components customElements O...
1. KVM virtual machine migration method and issue...
1. Mathematical Functions ABS(x) returns the abso...
To do a paginated query: 1. For MySQL, it is not ...
Linux is generally used as a server, and the serv...
This article shares the specific code of Vue3.0 h...
As a useful terminal emulator, Xshell is often us...
This article shares the specific code of JQuery t...
Preface The gradient of the old version of the br...
Problem Description As we all know, when writing ...