alexanderkustov
alexanderkustov

Reputation: 504

Azure Docker Container - how to pass startup commands to a docker run?

Faced with this screen, I have managed to easily deploy a rails app to azure, on docker container app service, but logging it is a pain since the only way they have access to logs is through FTP.

enter image description here

Has anyone figured out a good way to running the docker run command inside azure so it essentially accepts any params.

in this case it's trying to simply log to a remote service, if anyone also has other suggestions of retrieving logs except FTP, would massively appreciate.

Upvotes: 16

Views: 17899

Answers (2)

mithelan
mithelan

Reputation: 190

docker run command cannot be changed, if you want to add environmental variables then you can add the environmental variables in the app service which will be used by your docker image.

Upvotes: 0

4c74356b41
4c74356b41

Reputation: 72191

No, at the time of writing this is not possible, you can only pass in anything that you would normally pass to docker run container:tag %YOUR_STARTUP_COMMAND_WILL_GO_HERE_AS_IS%, so after your container name.

TLDR you cannot pass any startup parameters to Linux WebApp except for the command that needs to be run in the container. Lets say you want to run your container called MYPYTHON using the PROD tag and run some python code, you would do something like this

Startup Command = /usr/bin/python3 /home/code/my_python_entry_point.py

and that would get appended (AT THE VERY END ONLY) to the actual docker command:

docker run -t username/MYPYTHON:PROD /usr/bin/python3 /home/code/my_python_entry_point.py

Upvotes: 13

Related Questions