Skip to content

Commit

Permalink
Parameterize Dockerfiles (#24637)
Browse files Browse the repository at this point in the history
* ensure that we parameterize all docker files in the repo with targeted docker repo as a build argument
  • Loading branch information
scbedd authored Jun 2, 2022
1 parent 8be1483 commit efb3367
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 13 deletions.
4 changes: 3 additions & 1 deletion .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@
"deserialization",
"docfx",
"dotenv",
"dpkg",
"DWORD",
"eastus",
"eckey",
Expand Down Expand Up @@ -499,7 +500,8 @@
"nlocals",
"kwonlyargcount",
"dcid",
"startf"
"startf",
"dpkg"
]
}
],
Expand Down
7 changes: 4 additions & 3 deletions sdk/eventhub/azure-eventhub/stress/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# syntax=docker/dockerfile:1

FROM python:3.8-slim-buster
# internal users should provide MCR registry to build via 'docker build . --build-arg REGISTRY="mcr.microsoft.com/mirror/docker/library/"'
# public OSS users should simply leave this argument blank or ignore its presence entirely
ARG REGISTRY=""
FROM ${REGISTRY}python:3.8-slim-buster

WORKDIR /app

Expand Down
8 changes: 7 additions & 1 deletion sdk/identity/azure-identity/tests/azure-functions/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
# Licensed under the MIT License.
# ------------------------------------
# docker can't tell when the repo has changed and will therefore cache this layer
FROM alpine/git as repo

# internal users should provide MCR registry to build via 'docker build . --build-arg REGISTRY="mcr.microsoft.com/mirror/docker/library/"'
# public OSS users should simply leave this argument blank or ignore its presence entirely
ARG REGISTRY=""

FROM ${REGISTRY}alpine:3.14 as repo
RUN apk --no-cache add git
RUN git clone https://github.com/Azure/azure-sdk-for-python --single-branch --depth 1 /azure-sdk-for-python


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------

# internal users should provide MCR registry to build via 'docker build . --build-arg REGISTRY="mcr.microsoft.com/mirror/docker/library/"'
# public OSS users should simply leave this argument blank or ignore its presence entirely
ARG REGISTRY=""
ARG PYTHON_VERSION=3.9

# docker can't tell when the repo has changed and will therefore cache this layer
FROM alpine/git as repo
FROM ${REGISTRY}alpine:3.14 as repo
RUN apk --no-cache add git
RUN git clone https://github.com/Azure/azure-sdk-for-python --single-branch --depth 1 /azure-sdk-for-python


FROM python:${PYTHON_VERSION}-slim
FROM ${REGISTRY}python:${PYTHON_VERSION}-slim

COPY --from=repo /azure-sdk-for-python/sdk/identity /sdk/identity
COPY --from=repo /azure-sdk-for-python/sdk/core/azure-core /sdk/core/azure-core
Expand Down
7 changes: 4 additions & 3 deletions sdk/servicebus/azure-servicebus/stress/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# syntax=docker/dockerfile:1

FROM python:3.8-slim-buster
# internal users should provide MCR registry to build via 'docker build . --build-arg REGISTRY="mcr.microsoft.com/mirror/docker/library/"'
# public OSS users should simply leave this argument blank or ignore its presence entirely
ARG REGISTRY=""
FROM ${REGISTRY}python:3.8-slim-buster

WORKDIR /app

Expand Down
8 changes: 6 additions & 2 deletions tools/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
FROM ubuntu
MAINTAINER zikalino
# internal users should provide MCR registry to build via 'docker build . --build-arg REGISTRY="mcr.microsoft.com/mirror/docker/library/"'
# public OSS users should simply leave this argument blank or ignore its presence entirely
ARG REGISTRY=""
FROM ${REGISTRY}ubuntu:20.04
LABEL MAINTAINER=zikalino \
MAINTAINER=scbedd

RUN apt-get update
RUN apt-get install -y git curl gnupg vim python3 python3-pip git software-properties-common apt-transport-https wget python3-venv nodejs npm libunwind-dev
Expand Down

0 comments on commit efb3367

Please sign in to comment.