Skip to content

Commit 2aaa112

Browse files
committed
Improved maintainability of Dockerfile multistage build
1 parent 3acb05b commit 2aaa112

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ COPY . /azure-cli
5252
RUN ./scripts/install_full.sh
5353

5454
# Remove CLI source code from the final image and normalize line endings.
55-
RUN dos2unix az.completion /usr/local/bin/az
55+
RUN dos2unix /usr/local/bin/az /usr/local/bin/az.completion.sh
5656

5757
#---------------------------------------------------------------------------------------------
5858

@@ -76,9 +76,8 @@ LABEL maintainer="Microsoft" \
7676
org.label-schema.vcs-url="https://github.com/Azure/azure-cli.git" \
7777
org.label-schema.docker.cmd="docker run -v \${HOME}/.azure:/root/.azure -it mcr.microsoft.com/azure-cli:$CLI_VERSION"
7878

79-
COPY --from=builder /azure-cli/az.completion /root/.bashrc
8079
COPY --from=builder /usr/local /usr/local
81-
COPY --from=tools /usr/local/bin/jp /usr/local/bin/
80+
COPY --from=tools /usr/local /usr/local
8281

8382
RUN runDeps="$( \
8483
scanelf --needed --nobanner --recursive /usr/local \
@@ -87,7 +86,8 @@ RUN runDeps="$( \
8786
| xargs -r apk info --installed \
8887
| sort -u \
8988
)" \
90-
&& apk add --virtual .rundeps $runDeps
89+
&& apk add --virtual .rundeps $runDeps \
90+
&& ln -s /usr/local/bin/az.completion.sh /etc/profile.d/
9191

9292
ENV AZ_INSTALLER=DOCKER
9393
CMD bash

0 commit comments

Comments
 (0)