This container shows how to build a container that may be used as a executable. The idea is to use the ENTRYPOINT
and CMD
instructions together. The ENTRYPOINT
instruction points to the program and the CMD
instruction may be used to capture arguments passed into the docker container at runtime to pass to the program (pointed to by ENTRYPOINT
). In this example, we have a simple Python program that takes in the first, middle and last name and prints hello, first_name middle_name last_name!
back to the console.
Build it.
./build.sh
Run it.
Observe it.
docker run -it docker-exe:local -f Donald -m John -l Trump
Check out Ada Lovelace.
@misc{oneoffcoder_docker_exe_2019,
title={Showing how to create a container that may be used as an executable},
url={https://github.com/oneoffcoder/docker-containers/tree/master/docker-exe},
journal={GitHub},
author={One-Off Coder},
year={2019},
month={Aug}}