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
1. Databases and database instances In the study ...
Floating elements cause their parent elements to ...
Copy code The code is as follows: <HTML> &l...
Basic concepts: Macvlan working principle: Macvla...
In many cases, in order to beautify the form, the ...
Docker includes three basic concepts: Image: A Do...
SQL statement DROP TRIGGER IF EXISTS sys_menu_edi...
This article example shares the specific code of ...
1. Install dependency packages [root@localhost ~]...
This article shares with you the graphic tutorial...
Mapping the mouse position or implementing drag e...
Table of contents 1. Nginx installation and start...
In the previous article, we introduced the detail...
Purpose: Treat Station A as the secondary directo...
Table of contents 1. The concept of process and t...