pipe-cd / pipecd

The One CD for All {applications, platforms, operations}
https://pipecd.dev
Apache License 2.0
1.09k stars 153 forks source link

Failed to build piped-base-okd image when updating the version of the base image `piped-base` in piped-base-okd #5324

Open ffjlabo opened 5 days ago

ffjlabo commented 5 days ago

What happened:

When updating the version of the base image piped-base in piped-base-okd, failed to build the image on my local machine. I can build the image with the current Dockerfile.

% cd tool/piped-base-okd
% docker build . -t piped-base-okd                 
[+] Building 95.1s (7/7) FINISHED                                                                         docker:orbstack
 => [internal] load build definition from Dockerfile                                                                 0.1s
 => => transferring dockerfile: 1.52kB                                                                               0.0s
 => WARN: NoEmptyContinuation: Empty continuation line (line 37)                                                     0.1s
 => WARN: InvalidBaseImagePlatform: Base image ghcr.io/pipe-cd/piped-base@sha256:e5ce81bfd81b6d8d24b2caf9ec482c3f6d  0.1s
 => WARN: SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "NSS_WRAPPER_PASSWD") (  0.1s
 => [internal] load metadata for ghcr.io/pipe-cd/piped-base@sha256:e5ce81bfd81b6d8d24b2caf9ec482c3f6d11fff7ab96f6cc  0.0s
 => [internal] load .dockerignore                                                                                    0.0s
 => => transferring context: 2B                                                                                      0.0s
 => [internal] load build context                                                                                    0.0s
 => => transferring context: 1.09kB                                                                                  0.0s
 => CACHED [1/3] FROM ghcr.io/pipe-cd/piped-base@sha256:e5ce81bfd81b6d8d24b2caf9ec482c3f6d11fff7ab96f6cc6fc854e8237  0.0s
 => [2/3] COPY install-nss-wrapper.sh /installer/install-nss-wrapper.sh                                              0.1s
 => ERROR [3/3] RUN     apk add --no-cache         bash         gcc         libc-dev         musl-nscd-dev          94.7s
------
 > [3/3] RUN     apk add --no-cache         bash         gcc         libc-dev         musl-nscd-dev         make         jq         cmake &&     wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub &&     wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.33-r0/glibc-2.33-r0.apk &&     apk add glibc-2.33-r0.apk &&     /installer/install-nss-wrapper.sh &&     rm -rf /installer &&     rm -f /var/cache/apk/* &&     rm /glibc-2.33-r0.apk &&     grep -v -e ^default /etc/passwd > /home/piped/passwd &&     chown -R 1000:0 /home/piped &&     chmod 770 -R /home/piped:
0.185 fetch https://dl-cdn.alpinelinux.org/alpine/v3.20/main/x86_64/APKINDEX.tar.gz
1.622 fetch https://dl-cdn.alpinelinux.org/alpine/v3.20/community/x86_64/APKINDEX.tar.gz
2.774 (1/27) Installing readline (8.2.10-r0)
2.910 (2/27) Installing bash (5.2.26-r0)
3.158 Executing bash-5.2.26-r0.post-install
3.172 (3/27) Installing libacl (2.3.2-r0)
3.253 (4/27) Installing libbz2 (1.0.8-r6)
3.337 (5/27) Installing lz4-libs (1.9.4-r5)
3.439 (6/27) Installing xz-libs (5.6.2-r0)
3.574 (7/27) Installing libarchive (3.7.7-r0)
3.939 (8/27) Installing libgcc (13.2.1_git20240309-r0)
4.074 (9/27) Installing rhash-libs (1.4.4-r0)
4.245 (10/27) Installing libstdc++ (13.2.1_git20240309-r0)
4.931 (11/27) Installing libuv (1.48.0-r0)
5.084 (12/27) Installing cmake (3.29.3-r0)
18.20 (13/27) Installing jansson (2.14-r4)
18.31 (14/27) Installing binutils (2.42-r0)
20.98 (15/27) Installing libgomp (13.2.1_git20240309-r0)
21.13 (16/27) Installing libatomic (13.2.1_git20240309-r0)
21.20 (17/27) Installing gmp (6.3.0-r1)
21.39 (18/27) Installing isl26 (0.26-r1)
21.89 (19/27) Installing mpfr4 (4.2.1-r0)
22.09 (20/27) Installing mpc1 (1.3.1-r1)
22.17 (21/27) Installing gcc (13.2.1_git20240309-r0)
78.27 (22/27) Installing musl-dev (1.2.5-r0)
82.32 (23/27) Installing make (4.4.1-r2)
82.52 (24/27) Installing m4 (1.4.19-r3)
82.69 (25/27) Installing bison (3.8.2-r1)
83.46 (26/27) Installing flex (2.6.4-r6)
83.69 (27/27) Installing musl-nscd-dev (1.1.1-r4)
83.98 Executing busybox-1.36.1-r29.trigger
84.00 OK: 240 MiB in 67 packages
85.24 Connecting to github.com (20.27.177.113:443)
86.32 Connecting to objects.githubusercontent.com (185.199.111.133:443)
87.51 saving to 'glibc-2.33-r0.apk'
88.51 glibc-2.33-r0.apk     26% |********                        | 1167k  0:00:02 ETA
89.50 glibc-2.33-r0.apk     57% |******************              | 2511k  0:00:01 ETA
90.50 glibc-2.33-r0.apk     81% |**************************      | 3551k  0:00:00 ETA
91.20 glibc-2.33-r0.apk    100% |********************************| 4346k  0:00:00 ETA
91.20 'glibc-2.33-r0.apk' saved
91.24 fetch https://dl-cdn.alpinelinux.org/alpine/v3.20/main/x86_64/APKINDEX.tar.gz
92.37 fetch https://dl-cdn.alpinelinux.org/alpine/v3.20/community/x86_64/APKINDEX.tar.gz
94.47 ERROR: glibc-2.33-r0: trying to overwrite etc/nsswitch.conf owned by alpine-baselayout-data-3.6.5-r0.
94.47 (1/1) Installing glibc (2.33-r0)
94.53 1 error; 249 MiB in 68 packages
------

 3 warnings found (use docker --debug to expand):
 - InvalidBaseImagePlatform: Base image ghcr.io/pipe-cd/piped-base@sha256:e5ce81bfd81b6d8d24b2caf9ec482c3f6d11fff7ab96f6cc6fc854e82376fb3d was pulled with platform "linux/amd64", expected "linux/arm64" for current build (line 2)
 - SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "NSS_WRAPPER_PASSWD") (line 40)
 - NoEmptyContinuation: Empty continuation line (line 37)
Dockerfile:12
--------------------
  11 |
  12 | >>> RUN \
  13 | >>>     apk add --no-cache \
  14 | >>>         bash \
  15 | >>>         gcc \
  16 | >>>         libc-dev \
  17 | >>>         musl-nscd-dev \
  18 | >>>         make \
  19 | >>>         jq \
  20 | >>>         cmake && \
  21 | >>>
  22 | >>>     # Install glibc to be used for building nss_wrapper.
  23 | >>>     wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
  24 | >>>     wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.33-r0/glibc-2.33-r0.apk && \
  25 | >>>     apk add glibc-2.33-r0.apk && \
  26 | >>>
  27 | >>>     # Install nss_wrapper to add an random UID to "passwd" at runtime without having to directly modify /etc/passwd.
  28 | >>>     /installer/install-nss-wrapper.sh && \
  29 | >>>     # Remove what were used for installation.
  30 | >>>     rm -rf /installer && \
  31 | >>>     rm -f /var/cache/apk/* && \
  32 | >>>     rm /glibc-2.33-r0.apk && \
  33 | >>>     # Create the modifiable passwd file.
  34 | >>>     grep -v -e ^default /etc/passwd > $PIPED_HOME/passwd && \
  35 | >>>     # Grant access to the root group because all containers running on OKD belong to it.
  36 | >>>     chown -R $PIPED_UID:$ROOT_GID $PIPED_HOME && \
  37 | >>>     chmod 770 -R $PIPED_HOME
  38 |
--------------------
ERROR: failed to solve: process "/bin/sh -c apk add --no-cache         bash         gcc         libc-dev         musl-nscd-dev         make         jq         cmake &&     wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub &&     wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.33-r0/glibc-2.33-r0.apk &&     apk add glibc-2.33-r0.apk &&     /installer/install-nss-wrapper.sh &&     rm -rf /installer &&     rm -f /var/cache/apk/* &&     rm /glibc-2.33-r0.apk &&     grep -v -e ^default /etc/passwd > $PIPED_HOME/passwd &&     chown -R $PIPED_UID:$ROOT_GID $PIPED_HOME &&     chmod 770 -R $PIPED_HOME" did not complete successfully: exit code: 1

What you expected to happen:

How to reproduce it:

Environment: