Reputation: 331
I'm trying to build a Dockerfile based on the realm/realm-object-server image. To create a container with that image, I have to run the command:
$ docker run -p 9080:9080 -e ROS_TOS_EMAIL_ADDRESS="your-email-address" realm/realm-object-server
providing an email.
My Dockerfile starts:
FROM realm/realm-object-server:latest
how can I pass the ROS_TOS_EMAIL_ADDRESS environment variable to the FROM image? Otherwise it gives me an error later when executing the realm-object-server.
Upvotes: 0
Views: 1700
Reputation: 5165
There are multiple ways to pass env variables into docker.
docker run
command. Refer here.docker run
command. Refer hereenvironment
block in docker-compose Based on your question, first one is good enough.
Upvotes: 1
Reputation: 331
Oh, nevermind.
An ENV ROS_TOS_EMAIL_ADDRESS="email-goes-here" after FROM works. I thought it had to be set before FROM and only ARG was possible for that, which did not set an environment variable just a variable for the Dockerfile context.
Now it works.
Upvotes: 1