gliderlabs / docker-alpine

Alpine Linux Docker image. Win at minimalism!
http://gliderlabs.viewdocs.io/docker-alpine
BSD 2-Clause "Simplified" License
5.71k stars 529 forks source link

mkimage-alpine.bash in Jenkins Pipeline #510

Open ciaranrh opened 5 years ago

ciaranrh commented 5 years ago

Hello,

To integrate this into my Jenkins pipeline I added the --network=host flag to docker build at this location: https://github.com/gliderlabs/docker-alpine/blob/master/build#L21

However, when it hits the ENTRYPOINT command and the apk fetch command is run, my pipeline simply times out. This likely stems from my lack of Docker knowledge but I'm really slamming my head against the wall as to why fetch works in the pipeline but not inside the container even though the --network=host is specified.

Here's the console output from my pipeline:


+ ./build versions/library-3.8/x86_64/options
Sending build context to Docker daemon  8.704kB

Step 1/4 : FROM gcr.io/focus-electron-200718/base_image/alpine_base/atb-alpine-base-3.8:Build-Script
Build-Script: Pulling from focus-electron-200718/base_image/alpine_base/atb-alpine-base-3.8
71eb10b5171b: Pulling fs layer
044b512c3446: Pulling fs layer
54daec3891a7: Pulling fs layer
54daec3891a7: Download complete
044b512c3446: Verifying Checksum
044b512c3446: Download complete
71eb10b5171b: Verifying Checksum
71eb10b5171b: Download complete
71eb10b5171b: Pull complete
044b512c3446: Pull complete
54daec3891a7: Pull complete
Digest: sha256:3dffe4e6f5624a70dc3d47f11032fcbd21da969ac0d7233d7383711f982e0d95
Status: Downloaded newer image for gcr.io/focus-electron-200718/base_image/alpine_base/atb-alpine-base-3.8:Build-Script
 ---> 0123d858ce26
Step 2/4 : COPY scripts/mkimage-alpine.bash scripts/apk-install /
 ---> 8bd78eef9888
Step 3/4 : RUN apk add --no-cache bash tzdata xz
 ---> Running in f4fb070662c7
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
(1/8) Installing ncurses-terminfo-base (6.1_p20180818-r1)
(2/8) Installing ncurses-terminfo (6.1_p20180818-r1)
(3/8) Installing ncurses-libs (6.1_p20180818-r1)
(4/8) Installing readline (7.0.003-r0)
(5/8) Installing bash (4.4.19-r1)
Executing bash-4.4.19-r1.post-install
(6/8) Installing tzdata (2018i-r0)
(7/8) Installing xz-libs (5.2.4-r0)
(8/8) Installing xz (5.2.4-r0)
Executing busybox-1.28.4-r3.trigger
OK: 17 MiB in 21 packages
Removing intermediate container f4fb070662c7
 ---> e9ddda053459
Step 4/4 : ENTRYPOINT ["/mkimage-alpine.bash"]
 ---> Running in d17b0365459d
Removing intermediate container d17b0365459d
 ---> f8eee329b751
Successfully built f8eee329b751
Successfully tagged alpine-builder:latest
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
Cancelling nested steps due to timeout
Sending interrupt signal to process
Terminated
script returned exit code 143```