From 4efc62b3a0a494edd65a158073f2a8631c843e67 Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Wed, 6 Jul 2022 15:03:05 -0700 Subject: [PATCH] Fix invalid docker files (#4590) --- docker/all/ubuntu/Dockerfile | 8 +-- docker/dotnet/ubuntu/Dockerfile | 6 +- docker/python/ubuntu/Dockerfile | 2 +- docs/docker.md | 14 ++-- eng/pipelines/publish.yaml | 66 +++++++++---------- .../templates/build-and-push-docker.yaml | 18 ++--- 6 files changed, 53 insertions(+), 61 deletions(-) diff --git a/docker/all/ubuntu/Dockerfile b/docker/all/ubuntu/Dockerfile index 5c4fbdf60..7018234aa 100644 --- a/docker/all/ubuntu/Dockerfile +++ b/docker/all/ubuntu/Dockerfile @@ -1,9 +1,10 @@ FROM azsdkengsys.azurecr.io/azuresdk/autorest # DOTNET -ENV DOTNET_VERSION=5.0 +ENV DOTNET_VERSION=6.0 -RUN apt-get update \ +RUN echo 'deb http://security.ubuntu.com/ubuntu impish-security main' | tee /etc/apt/sources.list.d/impish-security.list && \ + apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ curl \ ca-certificates \ @@ -12,7 +13,6 @@ RUN apt-get update \ libc6 \ libgcc1 \ libgssapi-krb5-2 \ - libicu66 \ libssl1.1 \ libstdc++6 \ zlib1g \ @@ -23,7 +23,7 @@ RUN curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin -Channel ${ # PYTHON -ENV PYTHON_VERSION=3.8 +ENV PYTHON_VERSION=3.10 RUN apt-get update && apt-get install -y \ python${PYTHON_VERSION} \ diff --git a/docker/dotnet/ubuntu/Dockerfile b/docker/dotnet/ubuntu/Dockerfile index 5e36fb10e..2da0c85a3 100644 --- a/docker/dotnet/ubuntu/Dockerfile +++ b/docker/dotnet/ubuntu/Dockerfile @@ -1,8 +1,9 @@ FROM azsdkengsys.azurecr.io/azuresdk/autorest -ENV DOTNET_VERSION=5.0 +ENV DOTNET_VERSION=6.0 -RUN apt-get update \ +RUN echo 'deb http://security.ubuntu.com/ubuntu impish-security main' | tee /etc/apt/sources.list.d/impish-security.list && \ + apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ curl \ ca-certificates \ @@ -11,7 +12,6 @@ RUN apt-get update \ libc6 \ libgcc1 \ libgssapi-krb5-2 \ - libicu66 \ libssl1.1 \ libstdc++6 \ zlib1g \ diff --git a/docker/python/ubuntu/Dockerfile b/docker/python/ubuntu/Dockerfile index b7f0e3a39..2072368e3 100644 --- a/docker/python/ubuntu/Dockerfile +++ b/docker/python/ubuntu/Dockerfile @@ -1,6 +1,6 @@ FROM azsdkengsys.azurecr.io/azuresdk/autorest -ENV PYTHON_VERSION=3.8 +ENV PYTHON_VERSION=3.10 RUN apt-get update && apt-get install -y \ python${PYTHON_VERSION} \ diff --git a/docs/docker.md b/docs/docker.md index d2cab9c23..b9226ddd9 100644 --- a/docs/docker.md +++ b/docs/docker.md @@ -2,13 +2,13 @@ AutoRest provide some docker images: -| Image | Description | Image size | Ubuntu | -| -------------------------- | ------------------------------------------------------------------- | ---------------------------------------------------------------------- | ------------------ | -| `azuresdk/autorest` | Base image with node installed | ![](https://img.shields.io/docker/image-size/azuresdk/autorest) | :heavy_check_mark: | -| `azuresdk/autorest-python` | Base image + python 3 For building python sdk | ![](https://img.shields.io/docker/image-size/azuresdk/autorest-python) | :heavy_check_mark: | -| `azuresdk/autorest-dotnet` | Base image + dotnet. For building csharp sdk | ![](https://img.shields.io/docker/image-size/azuresdk/autorest-dotnet) | :heavy_check_mark: | -| `azuresdk/autorest-java` | Base image + java. For building java sdk | ![](https://img.shields.io/docker/image-size/azuresdk/autorest-java) | :heavy_check_mark: | -| `azuresdk/autorest-all` | Base image with all the languages for building any of the sdk above | ![](https://img.shields.io/docker/image-size/azuresdk/autorest-all) | :heavy_check_mark: | +| Image | Description | Ubuntu | +| ------------------------------------------------- | ------------------------------------------------------------------- | ------------------ | +| `azsdkengsys.azurecr.io/azuresdk/autorest` | Base image with node installed | :heavy_check_mark: | +| `azsdkengsys.azurecr.io/azuresdk/autorest-python` | Base image + python 3 For building python sdk | :heavy_check_mark: | +| `azsdkengsys.azurecr.io/azuresdk/autorest-dotnet` | Base image + dotnet. For building csharp sdk | :heavy_check_mark: | +| `azsdkengsys.azurecr.io/azuresdk/autorest-java` | Base image + java. For building java sdk | :heavy_check_mark: | +| `azsdkengsys.azurecr.io/azuresdk/autorest-all` | Base image with all the languages for building any of the sdk above | :heavy_check_mark: | ## Usage diff --git a/eng/pipelines/publish.yaml b/eng/pipelines/publish.yaml index 501f8bc30..bb8418cd1 100644 --- a/eng/pipelines/publish.yaml +++ b/eng/pipelines/publish.yaml @@ -37,36 +37,36 @@ stages: - script: | NPM_AUTH_TOKEN="$(azure-sdk-npm-token)" npx @microsoft/rush publish --publish --include-all --set-access-level public --tag next displayName: Publish packages - # - stage: Docker - # dependsOn: npm - # jobs: - # - template: ./templates/build-and-push-docker.yaml - # parameters: - # name: base - # image: azuresdk/autorest - # dockerFolder: ./docker/base/ubuntu - # readmePath: docker/base/readme.md - # - template: ./templates/build-and-push-docker.yaml - # parameters: - # name: dotnet - # image: azuresdk/autorest-dotnet - # dockerFolder: ./docker/dotnet/ubuntu - # readmePath: docker/dotnet/readme.md - # - template: ./templates/build-and-push-docker.yaml - # parameters: - # name: python - # image: azuresdk/autorest-python - # dockerFolder: ./docker/python/ubuntu - # readmePath: docker/python/readme.md - # - template: ./templates/build-and-push-docker.yaml - # parameters: - # name: java - # image: azuresdk/autorest-java - # dockerFolder: ./docker/java/ubuntu - # readmePath: docker/java/readme.md - # - template: ./templates/build-and-push-docker.yaml - # parameters: - # name: all - # image: azuresdk/autorest-all - # dockerFolder: ./docker/all/ubuntu - # readmePath: docker/all/readme.md + - stage: Docker + dependsOn: npm + jobs: + - template: ./templates/build-and-push-docker.yaml + parameters: + name: base + image: azsdkengsys.azurecr.io/azuresdk/autorest + dockerFolder: ./docker/base/ubuntu + readmePath: docker/base/readme.md + - template: ./templates/build-and-push-docker.yaml + parameters: + name: dotnet + image: azsdkengsys.azurecr.io/azuresdk/autorest-dotnet + dockerFolder: ./docker/dotnet/ubuntu + readmePath: docker/dotnet/readme.md + - template: ./templates/build-and-push-docker.yaml + parameters: + name: python + image: azsdkengsys.azurecr.io/azuresdk/autorest-python + dockerFolder: ./docker/python/ubuntu + readmePath: docker/python/readme.md + - template: ./templates/build-and-push-docker.yaml + parameters: + name: java + image: azsdkengsys.azurecr.io/azuresdk/autorest-java + dockerFolder: ./docker/java/ubuntu + readmePath: docker/java/readme.md + - template: ./templates/build-and-push-docker.yaml + parameters: + name: all + image: azsdkengsys.azurecr.io/azuresdk/autorest-all + dockerFolder: ./docker/all/ubuntu + readmePath: docker/all/readme.md diff --git a/eng/pipelines/templates/build-and-push-docker.yaml b/eng/pipelines/templates/build-and-push-docker.yaml index 5e12ffce3..1dff0fab3 100644 --- a/eng/pipelines/templates/build-and-push-docker.yaml +++ b/eng/pipelines/templates/build-and-push-docker.yaml @@ -17,9 +17,11 @@ jobs: inputs: dockerVersion: "17.09.0-ce" - - script: | - echo "$(DockerHub-azuresdkPass)" | docker login -u "azuresdk" --password-stdin - displayName: Login to docker hub. + - task: Docker@2 + displayName: Login to ACR + inputs: + command: login + containerRegistry: azsdkengsys - script: | docker build -t ${{ parameters.image }} . @@ -29,13 +31,3 @@ jobs: - script: | docker push ${{ parameters.image }} displayName: Publish image - - - script: | - echo '/workspace/${{parameters.readmePath}}' - docker run -v $PWD:/workspace \ - -e DOCKERHUB_USERNAME="azuresdk" \ - -e DOCKERHUB_PASSWORD="$(DockerHub-azuresdkPass)" \ - -e DOCKERHUB_REPOSITORY='${{ parameters.image }}' \ - -e README_FILEPATH='/workspace/${{parameters.readmePath}}' \ - peterevans/dockerhub-description:2.1.0 - displayName: Update readme