I tried to pass an argument to my docker entry point , but it fails , these are steps i followed
Docker Build Command : docker build -t "DBDNS" --build-arg db=sample
In Dockerfile
ARG db
ENV database ${db}
ENTRYPOINT ["/docker/entrypoint.sh", ${db}]
Error for this bash: 1: bash: [/var/www/html/.docker/entrypoint.sh,: not found
Actually file exists and passing an argument for entrypoint.sh causing issue. Any clues for this
-----------ENTRYPOINT---------------------
#!/usr/bin/env bash
echo "Entrypoint stuff"
echo "----------------"
echo "NEW APP DB CLONE FROM $1"
echo "sites/files permission changes"
echo "--------------------------------------"
Entrypoint cannot have a a variable. You can either move it to CMD or directly access it in
docker-entrypoint.sh
Even if you don't use CMD,
$database
will get you the value you need