farmer
farmer copied to clipboard
Chicken and egg with docker
Farmer has support for azure container registries and also for container services. Right now our deployment is a multi step process.
- create a container registry in farmer and store access key somewhere
- docker build
- docker push with access key from step 0)
- create webapp node in farmer and point it to the container
In a perfect world I'd like to see this:
- docker build
- add azure registry node in farmer
- point farmer webapp node to the local image
- farmer pushes the container automagically since it knows the azure container registry
We could probably use a PostDeploymentTask for this - we use a similar approach for app service where Farmer zips and uploads the web app directly into the app service that it's just deployed.
Is the docker push difficult to set up?
@forki I've been doing something recently that's very similar to what you're doing. I'm currently doing this as follows:
- Create ACR.
- Return the user, pass and server url as outputs.
- Use docker to build, tag and push the image to ACR.
- Create a web app and configure it to look at the ACR instance using the
docker_keywords on the web app.
I'm not sure I'm a fan of the idea of pointing a local docker image to a web app and having it implicitly upload that container's image to ACR - that feels like one step too many to me. However, I'd be interested in other people's thoughts @ninjarobot.
Instead of it building locally (or in CI) and then pushing the image, would it simplify your process to build the image on the registry itself? The build system will produce artifacts that are ready to copy to an image, and you can have your build system login to the ACR and then do a docker build directly on the ACR with az acr build.
@forki Hi, did any of the solutions presented help with resolving this issue?
we're still working with multi step deployment. but it's OK since we doig green/blue deployment anyways.
thanks for the help