Frames

Untitled

0
1
1#---------------------------------------------------------------------------------------------
2# Copyright (c) Microsoft Corporation. All rights reserved.
3# Licensed under the MIT License. See License.txt in the project root for license information.
4#---------------------------------------------------------------------------------------------
5
6ARG PYTHON_VERSION="3.6.10"
7
8FROM python:${PYTHON_VERSION}-alpine3.11
9
10ARG CLI_VERSION
11
12# Metadata as defined at http://label-schema.org
13ARG BUILD_DATE
14
15LABEL maintainer="Microsoft" \
16 org.label-schema.schema-version="1.0" \
17 org.label-schema.vendor="Microsoft" \
18 org.label-schema.name="Azure CLI" \
19 org.label-schema.version=$CLI_VERSION \
20 org.label-schema.license="MIT" \
21 org.label-schema.description="The Azure CLI is used for all Resource Manager deployments in Azure." \
22 org.label-schema.url="https://docs.microsoft.com/cli/azure/overview" \
23 org.label-schema.usage="https://docs.microsoft.com/cli/azure/install-az-cli2#docker" \
24 org.label-schema.build-date=$BUILD_DATE \
25 org.label-schema.vcs-url="https://github.com/Azure/azure-cli.git" \
26 org.label-schema.docker.cmd="docker run -v \${HOME}/.azure:/root/.azure -it mcr.microsoft.com/azure-cli:$CLI_VERSION"
27
28# bash gcc make openssl-dev libffi-dev musl-dev - dependencies required for CLI
29# openssh - included for ssh-keygen
30# ca-certificates
31
32# curl - required for installing jp
33# jq - we include jq as a useful tool
34# pip wheel - required for CLI packaging
35# jmespath-terminal - we include jpterm as a useful tool
36# libintl and icu-libs - required by azure devops artifact (az extension add --name azure-devops)
37RUN apk add --no-cache bash openssh ca-certificates jq curl openssl perl git zip \
38 && apk add --no-cache --virtual .build-deps gcc make openssl-dev libffi-dev musl-dev linux-headers \
39 && apk add --no-cache libintl icu-libs libc6-compat \
40 && apk add --no-cache bash-completion \
41 && update-ca-certificates
42
43ARG JP_VERSION="0.1.3"
44
45RUN curl -L https://github.com/jmespath/jp/releases/download/${JP_VERSION}/jp-linux-amd64 -o /usr/local/bin/jp \
46 && chmod +x /usr/local/bin/jp \
47 && pip install --no-cache-dir --upgrade jmespath-terminal
48
49WORKDIR azure-cli
50COPY . /azure-cli
51
52# 1. Build packages and store in tmp dir
53# 2. Install the cli and the other command modules that weren't included
54RUN ./scripts/install_full.sh \
55 && cat /azure-cli/az.completion > ~/.bashrc \
56 && runDeps="$( \
57 scanelf --needed --nobanner --recursive /usr/local \
58 | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
59 | sort -u \
60 | xargs -r apk info --installed \
61 | sort -u \
62 )" \
63 && apk add --virtual .rundeps $runDeps
64
65WORKDIR /
66
67# Remove CLI source code from the final image and normalize line endings.
68RUN rm -rf ./azure-cli && \
69 dos2unix /root/.bashrc /usr/local/bin/az
70
71ENV AZ_INSTALLER=DOCKER
72CMD bash
73