Forrest logo
back to the docker tool

docker:tldr:83142

docker: Build with custom build-time variables.
$ docker build --build-arg ${HTTP_PROXY=http:--10-20-30-2:1234} --build-arg ${FTP_PROXY=http:--40-50-60-5:4567} .
try on your machine

The given command is used to build a Docker image using the Dockerfile in the current directory (denoted by the '.' at the end).

Let's break down the full command:

  1. docker build: This command is used to build an image from a Dockerfile.

  2. --build-arg: This option is used to set build-time variables that can be accessed within the Dockerfile. It allows passing arguments to the build process.

  3. ${HTTP_PROXY=http:--10-20-30-2:1234}: This is specifying a build-time variable HTTP_PROXY with the value "http://10.20.30.2:1234". The format of the variable is ${VAR_NAME=variable_value}.

  4. ${FTP_PROXY=http:--40-50-60-5:4567}: This is specifying another build-time variable FTP_PROXY with the value "http://40.50.60.5:4567".

  5. .: This dot represents the build context, which is the current directory. It tells Docker to use the Dockerfile present in the current directory for building the image.

In summary, the given command instructs Docker to build an image using a Dockerfile, while also setting two build-time variables - HTTP_PROXY and FTP_PROXY - which can be accessed within the Dockerfile. These variables define the proxy settings for HTTP and FTP connections respectively.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the docker tool