AKS icon indicating copy to clipboard operation
AKS copied to clipboard

Current version of docker does not support multi stage builds for CICD pipelines

Open IainColledge opened this issue 8 years ago • 10 comments

Overview

When using AKS as the platform for enabling CICD pipelines and specifically the building of Docker images one usually connects to the underlying node docker daemon by deploying a pod with /var/run/docker.sock being made available to the "building" pod.

For example for a Deployment or Stateful set:

        volumeMounts:
        - name: docker-socket
          mountPath: /var/run/docker.sock

...

      volumes:
        - name: docker-socket
          hostPath:
            path: /var/run/docker.sock

The version of docker on the underlying nodes is 1.13.1 released in (2017-02-08) and multi stage builds are supported from 17.05.0 released (2017-05-04) onwards.

Please can the version of docker be updated to a modern release as the subsequent drift is minimising the utility of the Azure Kubernetes Managed Service, i.e. it cannot be utilised for modern DevOps CICD pipelines.

Ironically a side effect is that one of the examples used for developing and running applications in the AKS documentation, OpenFAAS (https://docs.microsoft.com/en-us/azure/aks/openfaas), does not work with csharp because multi stage builds are not supported.

IainColledge avatar Jun 07 '18 14:06 IainColledge

To tease out the specific need for docker build and socket requested above from the docker version run in AKS, we should point out we support builds in Azure with ACR Build - https://aka.ms/acr/build ACR Build not only supports multi-stage dockerfiles, but streamlined, local builds az acr build . and base image updates for OS & Framework patching. As AKS evolves, we expect more and more of the underlying infrastructure to become managed by the cloud vendor, in this case Azure. Consider ACI, where you don't have access to the host. Azure manages the host for patching, instancing, and you pay for what you use. ACR build works the same way: https://aka.ms/acr/pricing

If you do have requests for ACR build, you can submit to User Voice: https://aka.ms/acr/uservoice

I'd suggest we should close this item as the CI/CD scenario is covered by ACR Build. Updating the version of docker for various other reasons should be tracked as a separate issue.

SteveLasker avatar Jun 19 '18 17:06 SteveLasker

I work for a large healthcare multinational who has a requirement to be able to deploy anywhere due to having to comply with local data residency requirements.

To that end we have Kubernetes as our abstraction layer for app deployment on clusters and deploy CICD pipelines if required on top of that. ACR whilst convenient does not offer the same utility as a Kubernets PAAS offering with an up to date Docker version as I cannot replicate it where Azure is not present and frameworks such as OpenFAAS will not work.

What you're signalling to mine and other companies that have the same constraints is that we would be better off deploying OpenShift on IAAS rather than using AKS. Is that the strategy you want?

IainColledge avatar Jun 19 '18 19:06 IainColledge

Each cloud is offering build services that are optimized for the task. In reality, clouds offer various services with specific values, that happen to use containers as the app deployment model. While kubernetes is a generic container orchestration service, it's not necessarily best for all workloads. I don't want to speak for the overall goals specific to AKS as we're always seeking feedback. What I am saying is you can certainly use the least common denominator of running kubernetes, or even ACS to get deeper access to the underlying infrastructure. And, we should update the docker version regardless. From a build service, Google Container Builder, AWS Builder and ACR Builder are providing values that enable optimized experiences around building containers. ISVs that are and should be, cloud agnostic do wind up implementing cloud specific capabilities. For instance, how do you configure and deploy kubernetes on-prem or across the 3 clouds? What do you do for auth and storage across clouds and on-prem? I'm just suggesting build is a scenario that you'll likely want to take advantage of the specific services offered by each cloud for specific services. I should also note that we are working to standardize comodotized things, such as integrating security scanning solutions. Here's a proposal we're working on to that end: https://github.com/docker/distribution/issues/2600

SteveLasker avatar Jun 19 '18 21:06 SteveLasker

If one is constrained to be able to deploy anywhere then alas taking advantage of cloud vendor specific models is not an option. Kubernates might not be ideal but it is the only common abstraction layer at this time.

For multi vendor we have differentiation below the Kubernetes layer but aim not to have to above and this provides a nice way of abstracting implementation specifics for infrastructure from tin to cloud. It's just less work and what would the extra effort gain over using docker to build an image?

IainColledge avatar Jun 19 '18 21:06 IainColledge

Having been an ISV and consultant, I certainly understand the desire. We should get the version updated. There's no argument here. And, once done, you'll have multi-stage builds, for hosted VM nodes. In other words, it won't work when bursting into ACI instances. For less vs. more, there are values to each service. For instances, would you run your storage in a container? Or, run one of the platform vendors managed storage services? Build is one of those types of services. ACR Build provides inner loop builds az acr build . as well as git-commit triggered builds. It also provides OS & Framework patching you won't get from the other clouds ...yet as I'm sure they'll come around to it. We have other capabilities of ACR Build that I think you'll find a huge advantage. If you're not looking to leverage the vantages of each deployment, what will you do when your competitors do? I'd also suggest, depending on how complex your solution is, do you need Kubernetes? Could you run on App Service as even managed Kubernetes is still a lot for a company to run. Running in containers is the great part, but why limit them to how they run their containers. Anyway, this is a bit of strategic/hypothetical conversation as I do agree we should enable the current version. I'm just suggesting building containers isn't necessarily the best reasoning for it as we do provide these services.

SteveLasker avatar Jun 19 '18 22:06 SteveLasker

So remember what I said our constraints are.

Anyway am glad staying current with the underlying docker engine is a goal, thanks for confirming, do you have any dates please?

IainColledge avatar Jun 20 '18 19:06 IainColledge

I came across the same problem because we deploy our agents on aks as well. Unfortunately i think it's not an AKS issue but a Kubernetes issue in general. As you can see here. The newest version of Kubernetes (1.11) only supports these versions of docker v1.10: 1.11.2 to 1.13.1 and 17.03.x . That basically means 17.05 or higher is not officially supported by Kubernetes. Correct me if i'm wrong though, but that's my interpretation of it.

SurushS avatar Jun 28 '18 22:06 SurushS

@slack can you pop in here on AKS version plans

SteveLasker avatar Jun 28 '18 22:06 SteveLasker

@SurushS Thanks for that, I did a little bit of nosing around and it does look like that is the case, Kubernetes currently supports 17.03.xx only.

I see there is another issue raised to up the supported version because they also want to use multistage builds.

https://github.com/kubernetes/kops/issues/5047

IainColledge avatar Jun 29 '18 15:06 IainColledge

You can track the request to update the container runtime here:

https://feedback.azure.com/forums/914020-azure-kubernetes-service-aks/suggestions/34917076-increase-kubernetes-node-docker-version-to-17-05-x

seanmck avatar Aug 03 '18 16:08 seanmck