<p>Application was using docker CLI to build and then push an image to azure container registry. Used to work fine on Kubernetes using a python module and docker.sock. But since cluster upgraded docker daemon is gone. Guessing the K8 backend no longer uses docker or has it installled. Also, since docker is going away in kubernetes (i think it said 1.24 I want to get away from counting on docker for the build.</p>
<p>So the application when working was python application running in a docker container. It would take the dockerfile and build it and push it to azure container registry. There are files that get pushed into the image via the dockerfile and they all exist in the same directory as the dockerfile.</p>
<p>Anyone know of different methods to achieve this?</p>
<p>I've been looking at Azure ACR Tasks but I'm not really sure how all the files get copied over to a task and have not been able to find any examples.</p>

Kyle N
<p>I can confirm that running an Azure ACR Task (Multi-Task or Quick Task) will copy the files over when the command is executed. We're using <a href="https://learn.microsoft.com/en-us/azure/container-registry/container-registry-tasks-overview#task-scenarios" rel="nofollow noreferrer">Azure ACR Quick Tasks</a> to achieve something similar. If you're just trying to do the equivalent of <code>docker build</code> and <code>docker push</code>, Quick Tasks should work fine for you too.</p>
<p>For simplicity I'm gonna list the example for a Quick Task because that's what I've used mostly. Try the following steps from your local machine to see how it works. Same steps should also work from any other environment provided the machine is authenticated properly.</p>
<p>First make sure you are in the Dockerfile directory and then:</p>
<ol>
<li>Authenticate to the Azure CLI using <code>az login</code></li>
<li>Authenticate to your ACR using <code>az acr login --name myacr</code>.</li>
<li>Replace the values accordingly and run <code>az acr build --registry myacr -g myacr_rg --image myacr.azurecr.io/myimage:v1.0 .</code></li>
<li>Your terminal should already show all of the steps that the Dockerfile is executing. Alternatively you can head over to your ACR and look under <code>services&gt;tasks&gt;runs</code>. You should see every line of the Docker build task appear there.</li>
</ol>
<p>Note: If you're running this task in an automated fashion and also require access to internal/private resources during the image build, you should consider creating a <a href="https://learn.microsoft.com/en-us/azure/container-registry/tasks-agent-pools" rel="nofollow noreferrer">Dedicated Agent Pool</a> and deploying it in your VNET/SNET, instead of using the shared/public Agent Pools.</p>
<p>In my case, I'm using terraform to run the <code>az acr build</code> command and you can see the Dockerfile executes the <code>COPY</code> commands without any issues.</p>
<p><a href="https://i.stack.imgur.com/u4Z2H.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/u4Z2H.png" alt="enter image description here" /></a></p>
