vandekerkoff
vandekerkoff

Reputation: 435

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

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.

Upvotes: 6

Views: 5492

Answers (2)

evilSnobu
evilSnobu

Reputation: 26324

The current approach for doing that in App Service Linux is to enable SSH to your container - https://learn.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

Upvotes: 2

Related Questions