Skip to content

How to use environment variables on the CMD field of a Dockerfile

Notifications You must be signed in to change notification settings

resnullius/docker-test-echo-envs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Docker test: environment variables in CMD

Example on how to use environment variables on the CMD field of a Dockerfile.

Basically:

ENTRYPOINT ["sh", "-c"]
CMD ["your command $THE_ENV_VAR"]

You can build and test it with run.sh.

This example is fully functional in showing how it gets done.

About

How to use environment variables on the CMD field of a Dockerfile

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages