1. The ENV instruction in the Dockerfile is used to define the environment variables of the image. Here is an example: RUN set -ex && apt-get update && apt-get install -y iputils-ping ENV PATH /usr/local/bin:$PATH ENV LANG C.UTF-8 ENV TERM xterm ENV PYTHON_VERSION 3.5.3 ENV name1=ping name2=on_ip CMD $name1 $name2 Note: When defining environment variables, you can reference already defined environment variables. In the ENV directive, you can directly reference the following environment variables:
2. Due to the hierarchical file system of the image, the environment variables defined by ENV can only be applied in subsequent layers. The example is as follows: ENV abc=hello ENV abc=bye def=$abc ENV ghi=$abc illustrate: In the above definition, def = hello, ghi = bye 3. After starting the container, you can view the environment variables in the container instance through the env command env Reference Links: https://docs.docker.com/engine/reference/builder/ The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Problems encountered when uploading images using axios in Vue
>>: How to install mysql5.7.24 binary version on Centos 7 and how to solve it
Table of contents What is axios? Axios request ty...
Mysql auto-increment primary key id does not incr...
Table of contents Some basic instructions 1. Chec...
Table of contents forEach() (ES6) method map() (E...
Preface NAT forwarding: Simply put, NAT is the us...
Preface: I believe that those who need to underst...
1 Question The company's server uses Apache, ...
Table of contents Introduction to utf8mb4 UTF8 by...
Preface MRR is the abbreviation of Multi-Range Re...
1. Introduction CentOS8 system update, the new ve...
1. How to display the date on the right in the art...
Today I am a little confused about <a href=&quo...
question: When developing the Alice management sy...
Nginx: PV, UV, independent IP Everyone who makes ...
Computed properties Sometimes we put too much log...