Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 855
alexanderkustov Avatar asked Mar 14 '17 14:03

alexanderkustov


People also ask

Which docker command is used to attach to a running?

Use docker attach to attach your terminal's standard input, output, and error (or any combination of the three) to a running container using the container's ID or name. This allows you to view its ongoing output or to control it interactively, as though the commands were running directly in your terminal.


1 Answers

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
like image 116
4c74356b41 Avatar answered Oct 02 '22 05:10

4c74356b41