Docker Community Forums

Share and learn in the Docker community.

How create docker build and use ARG in ENTRYPOINT

(Avnersib) #1

I try to create dockerbuild file,
in the file i use ARG.
and when i use in ENTRYPINT its not get the ARG.
how i can use its ?


(Vsupalov) #2

Hey there! How about you assign the ARG value to an ENV? This way the container you run from the image will have access to the value :slight_smile:

Like so:
ARG some_variable_name
ENV env_var_name=$some_variable_name

You can read up on the difference between ARG and ENV here.

(Avnersib) #3

tnx for response.
this don’t work.
i try copy script into image and when i run image i wont run this script through ENTRYPOINT
this is error log from “docker logs id”
/bin/sh: [/opt/]: No such file or directory

(Wonkabar) #4

can you post an example of your entrypoint and your Dockerfile?

(Avnersib) #5

it’s work i use arg and env
tnx vsupalov