composerize
composerize copied to clipboard
-c parameter's content doesn't seems to be recognized inside entrypoint
Do you want to request a feature or report a bug?
- [ ] feature request
- [x] bug report
Please provide a sample input docker run command
docker run -d -p 8080:8080 -v "$PWD/airflow/dags:/opt/airflow/dags/" --entrypoint=/bin/bash --name airflow apache/airflow:2.1.1-python3.8 -c '(airflow db init && airflow users create --username admin --password stack --firstname Felipe --lastname Lastname --role Admin --email [email protected]); airflow webserver & airflow scheduler'
Content of -c parameter doesn't seems to be recognized, while it displays only "bin/bash" and forgets all the rest inside -c '
What is the current output?*
version: '3.3'
services:
airflow:
ports:
- '8080:8080'
volumes:
- '$PWD/airflow/dags:/opt/airflow/dags/'
entrypoint:
- /bin/bash
container_name: airflow
image: 'apache/airflow:2.1.1-python3.8'
What is the expected/desired output? This is the corrected output, it works fine for me, the container works.
version: '3.3'
services:
airflow:
container_name: airflow
image: 'apache/airflow:2.1.1-python3.8'
ports:
- '8080:8080'
volumes:
- '$PWD/airflow/dags:/opt/airflow/dags/'
entrypoint:
- /bin/bash
- -ecx
- |
airflow db init && airflow users create --username admin --password stack --firstname Felipe --lastname Lastname --role Admin --email [email protected]
airflow webserver & airflow scheduler
Things I noticed:
missing:
- /bin/bash
- -ecx (missing this line for multiple commands)
- | (also this one for multiple commands)
(new line with command sequence)
and everything that comes inside -c.
Also, notice that if we encounter a ; , like in (long command1); command2; command3 we should jump a line, getting in result
entrypoint:
- "/bin/bash"
- -ecx
- |
long command1
command2
command3