docker-compose entrypoint tag escaping single quotes not working..
I tried the code to escape single quotes in docker-docker entrypoint tag. This works from my command line but doesn’t work from docker-compose entrypoint…
Here is my sample code from test.yml:
version: “2.4”
services:
mysql:
container_name: test
image: “docker.imanage.com/imanagelabs/multiplatform/java-build:21-focal”
entrypoint:
/bin/bash -c ”
echo $’CREATE DATABASE IF NOT EXISTS temporal; CREATE DATABASE IF NOT EXISTS temporal_visibility; GRANT ALL PRIVILEGES ON . TO ‘temporal_admin’@’%’; GRANT ALL PRIVILEGES ON . TO ‘temporal_admin’@’%’; FLUSH PRIVILEGES;’ > /tmp/init.sql;
cat /tmp/init.sql
“
Output: CREATE DATABASE IF NOT EXISTS temporal; CREATE DATABASE IF NOT EXISTS temporal_visibility; GRANT ALL PRIVILEGES ON . TO temporal_admin@%; GRANT ALL PRIVILEGES ON . TO temporal_admin@%; FLUSH PRIVILEGES;
as you can see escaping single quotes doesn’t work…any ideas?
Narayan Agarwal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.