Personalized Greeting Docker

Published:

Here i showcase and explain the process to make this project to see only the file check the Github repo

The first thing was to import the distro i will use to do this simple project, i used Alpine linux because it’s pretty lightweight.

FROM alpine:latest

And then i add CMD so the command initiates automatically when started, so i dont have to echo manually
“sh” is used to run the following command in a shell
“-c” is to tell the shell to run it as a command
the NAME has a custom value (we will assign the value later on) but :- indicates World as the default value if nothing else inputted

CMD ["sh", "-c", "echo Hello, ${NAME:-World}!"]