Environmental variables
In this section, we will cover the very powerful environmental variables or ENVs, as you will be seeing a lot of them. You can use environmental variables for a lot of things from your Dockerfile. If you are familiar with coding, these will probably come as secondhand to you. For others like myself, at first, they may seem intimidating; but don't get discouraged. They will be your best resource once you get the hang of them. They can be used from creating MySQL users, passwords, and databases to setting application items such as memory limits. We will cover some examples that you can use for future reference.
Using environmental variables in your Dockerfile
To use environmental variables in your Dockerfile, you can use the ENV
instruction. The structure of the ENV
instruction is:
ENV <key> <value> ENV username admin
Else, you can always use an equals sign between the two:
ENV <key>=<value> ENV username=admin
Now, the question is why do they have...