Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I run commands remotely on a container launched with App Services for Containers?

Tags:

azure

I'm trying out the new webapp service for linux/containers with a custom docker image I've pushed up to an ACR.

https://azure.microsoft.com/en-gb/blog/webapp-for-containers-overview/

We've got it up and running, a django app, nicely.

What I need to do now though is to be able to run one off commands in the containers we're making.

Could anyone point me in the right direction on how to accomplish that?

Any help, greatly appreciated.

like image 415
vandekerkoff Avatar asked Sep 07 '17 09:09

vandekerkoff


2 Answers

The current approach for doing that in App Service Linux is to enable SSH to your container - https://docs.microsoft.com/en-us/azure/app-service-web/app-service-linux-ssh-support

# ------------------------
# SSH Server support
# ------------------------
RUN apt-get update \ 
  && apt-get install -y --no-install-recommends openssh-server \
  && echo "root:Docker!" | chpasswd

You can then SSH into it through the Kudu console (which uses WebSSH) -

WebSSH

like image 158
evilSnobu Avatar answered Oct 19 '22 21:10

evilSnobu


I'm pretty sure its not possible with Azure Web App yet.

Useful links:
https://docs.microsoft.com/en-us/azure/app-service-web/app-service-linux-ssh-support
https://docs.microsoft.com/en-us/azure/app-service-web/app-service-linux-using-custom-docker-image#troubleshooting

like image 20
4c74356b41 Avatar answered Oct 19 '22 20:10

4c74356b41