Run Docker inside a container running in Azure Container Instance?

admanb-vw 21 Reputation points
2022-08-22T17:10:56.867+00:00

I have a worker service that will be running in a container deployed to an Azure Container Instance that needs to run a series of Docker commands to manage incoming and outgoing containers -- specifically an import to a local registry, then push to a remote registry, or a pull from remote then push to remote and I'm wondering how to get that done. Docker-in-Docker in an ACI specifically doesn't seem possible: [43947][1, but it seems like Podman-in-Docker might due to lower requirements? This doesn't seem like an uncommon usecase, so it seems like someone would've figured out how to do it in an ACI.

Azure Container Registry
Azure Container Registry
An Azure service that provides a registry of Docker and Open Container Initiative images.
511 questions
Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
757 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Andriy Bilous 11,821 Reputation points MVP Volunteer Moderator
    2022-08-25T06:01:55.193+00:00

    Hello @admanb-vw

    You are right Azure Container Instances does not expose direct access to the underlying infrastructure that hosts container groups. This includes access to the Docker API running on the container's host and running privileged containers.

    You can try to use podman inside Docker container and run it in Azure WebApp, ACI or Container App but you can get an issue ACR login does not work with podman

    I would recommend you to use Azure ACR tasks inside Docker

    https://learn.microsoft.com/en-us/azure/container-instances/container-instances-troubleshooting#cannot-connect-to-underlying-docker-api-or-run-privileged-containers

    If you think your question has been answered, click "Mark as Accept Answer" if just helped click "Vote as helpful". This can be beneficial to other community members reading this forum thread.

    2 people found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.