Just to get the hang of this feature, which is very good, let's create a small Docker image that converts a string to uppercase or lowercase, depending on the state of an environment variable.
The Docker image will be based on the latest Debian distribution and will have only an
ENTRYPOINT command. This is the
FROM debian:latest ADD ./case.sh /root/case.sh RUN chmod +x /root/case.sh ENTRYPOINT /root/case.sh
This takes the
case.sh file from our current directory, adds it to the container, makes it executable, and assigns it as
case.sh file may look something like this:
#!/bin/bash if [ -z "$STR" ]; then echo "No STR string specified." exit 0 fi if [ -z "$TO_CASE" ]; then echo "No TO_CASE ...