Skip to content

Commit 2f93501

Browse files
authored
Force docker build to clean up repeated layers (#4434)
## Motivation and Context Works around the `failed to register layer: max depth exceeded` error on `docker pull` ## Description Force building an docker image removes repeated image layers ``` "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef", "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef", "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef", ... ``` whose layer contents include ``` Command: RUN |1 USER_ID=1001 /bin/sh -c useradd -l -u ${USER_ID} -G build -o -s /bin/bash localbuild || { exit_code=$?; [ $exit_code -eq 9 ] && echo "User localbuild already exists, continuing..." || { echo "Failed to create user with error code: $exit_code"; exit $exit_code; }; } # buildkit ``` The layer seems to be added [here](https://github.com/smithy-lang/smithy-rs/blob/42d082f37b28d900885070342be710d287bc1dcc/.github/scripts/acquire-build-image#L256). Will describe more in an ops issue we'll be creating. This PR just unblocks PRs that need to run CI. ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._
1 parent 42d082f commit 2f93501

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

.github/workflows/ci-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
# it uploads the image as a build artifact for other jobs to download and use.
5555
acquire-base-image:
5656
name: Acquire Base Image
57-
timeout-minutes: 60
57+
timeout-minutes: 90
5858
needs: save-docker-login-token
5959
if: ${{ github.event.pull_request.head.repo.full_name == 'smithy-lang/smithy-rs' }}
6060
runs-on: smithy_ubuntu-latest_8-core

tools/ci-build/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ RUN set -eux; \
226226
rm -rf awscliv2.zip aws && \
227227
pip3 install --no-cache-dir mypy==0.991
228228

229-
COPY --chown=build:build --from=local_tools /opt/cargo /opt/cargo
230229
COPY --chown=build:build --from=gradle_wrapper /opt/gradle /home/build/.gradle
230+
COPY --chown=build:build --from=local_tools /opt/cargo /opt/cargo
231231
COPY --chown=build:build --from=cargo_tools /opt/cargo/bin/ /opt/cargo/bin/
232232
COPY --chown=build:build --from=install_rust /opt/rustup /opt/rustup
233233
COPY --chown=build:build --from=nodejs /opt/nodejs /opt/nodejs

0 commit comments

Comments
 (0)