I cannot manage to deploy 'ubuntu' to Azure Container instance without it becoming "Terminated" right after the deployment. I tried setting the command
to ["/bin/bash"], however, it doesn't stop the container from terminating.
Asked
Active
Viewed 1,151 times
0

mnj
- 2,539
- 3
- 29
- 58
-
Please share container logs and Dockerfile. – Kapil Khandelwal Apr 23 '20 at 07:49
-
I'm using the official "ubuntu" image (https://hub.docker.com/_/ubuntu). There are no logs . The container just terminates right after the deployment. – mnj Apr 23 '20 at 07:59
1 Answers
3
It's a common issue you can see. The docker image ubuntu
just provides the base container, but no application runs in it to make the Container Instance in the running state. So you need to add the command in the command line to make the container instance in the running state. For example, add the command tail -f /dev/null
.
When you do it in the portal, it should look like this:
It just keeps the container in the running state and does not output anything. So there are no logs output.

Charles Xu
- 29,862
- 2
- 22
- 39
-
Tried that. My container ends-up in "Waiting" state. The logs are: "failed to open log file "/var/log/pods/332be5a9-853c-11ea-ac43-000d3ad84afd/ubuntu-aci-1_4.log": open /var/log/pods/332be5a9-853c-11ea-ac43-000d3ad84afd/ubuntu-aci-1_4.log: no such file or directory" – mnj Apr 23 '20 at 08:31
-
1@Loreno Can you share the command you used to create the container instance? – Charles Xu Apr 23 '20 at 08:32
-
I did it through Azure Portal. The command that I used (in the advanced tab) was, as you proposed: ["tail -f /dev/null"] – mnj Apr 23 '20 at 09:04
-
Works! Looks like it is necessary to split parts of the command into separate strings in the array. Do you know why is that? Previously I did one string in the array and it failed. – mnj Apr 23 '20 at 09:19
-
1@Loreno It's the types defined for [CMD](https://docs.docker.com/engine/reference/builder/#cmd) in Dockerfile. – Charles Xu Apr 23 '20 at 09:22
-