Category : shell

The docker documentation says that you can build this minimal image: FROM scratch ADD hello / CMD ["/hello"] Presumably the way this works is that the CMD step is using the default shell (that is, bin/sh, per https://stackoverflow.com/a/21564990/10900852) to run the hello executable. But if SCRATCH is really entirely empty, where is bin/sh coming from? ..

Read more

This is normal way of doing in shell starttime=$(date ‘+%d/%m/%Y %H:%M:%S’) #echo $starttime # sleep for 5 seconds sleep 5 # end time endtime=$(date ‘+%d/%m/%Y %H:%M:%S’) #echo $endtime STARTTIME=$(date -d "${starttime}" +%s) ENDTIME=$(date -d "${endtime}" +%s) RUNTIME=$((ENDTIME-STARTTIME)) echo "Seconds ${RUNTIME} in sec" Wanted the same way in a docker file Wanted to get the timestamps ..

Read more

I have a container Postgres that in its Dockerfile it launches a docker-entrypoint.sh and inside that shell file there is a command that I want to remove using this command: sed -i ‘s/exec "[email protected]"//g’ docker-entrypoint.sh The goal is to be able to run the container with the modified docker-entrypoint.sh (without the exec "@") How can ..

Read more