Open aaronpkelly opened 2 years ago
Could you try building the image with BuildKit enabled?
(e.g. DOCKER_BUILDKIT=1 docker build .
)
@Patryk27 when using BuildKit with docker build
, it causes the command to fail (in much the same way as docker-compose
does):
❯ DOCKER_BUILDKIT=1 docker build --no-cache -f Dockerfile_fork_rjarry -t aaronkelly/aerc .
[+] Building 12.7s (8/12)
=> [internal] load build definition from Dockerfile_fork_rjarry 0.4s
=> => transferring dockerfile: 1.08kB 0.0s
=> [internal] load .dockerignore 0.4s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/alpine:edge 0.0s
=> [internal] load build context 0.3s
=> => transferring context: 97.03kB 0.0s
=> CACHED [builder 1/4] FROM docker.io/library/alpine:edge 0.0s
=> [builder 2/4] COPY . /app 0.5s
=> [builder 3/4] WORKDIR app 0.3s
=> ERROR [builder 4/4] RUN apk update && apk add --no-cache alpine-sdk git go 10.7s
------
> [builder 4/4] RUN apk update && apk add --no-cache alpine-sdk git go scdoc w3m dante && git clone "https://git.sr.ht/~rjarry/aerc" && cd aerc && make && make install:
#8 0.444 fetch https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
#8 5.450 ERROR: https://dl-cdn.alpinelinux.org/alpine/edge/main: temporary error (try again later)
#8 5.450 WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/edge/main: No such file or directory
#8 5.450 fetch https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
#8 10.46 ERROR: https://dl-cdn.alpinelinux.org/alpine/edge/community: temporary error (try again later)
#8 10.46 WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/edge/community: No such file or directory
#8 10.46 2 errors; 14 distinct packages available
------
executor failed running [/bin/sh -c apk update && apk add --no-cache alpine-sdk git go scdoc w3m dante && git clone "$GIT_REPO" && cd aerc && make && make install]: exit code: 2
So with the finger starting to point toward BuildKit... I tried disabling BuildKit for docker-compose
... and the command was successful!
❯ DOCKER_BUILDKIT=0 docker-compose build
Sending build context to Docker daemon 55.69kB
Step 1/12 : FROM alpine:edge as builder
---> 49b6d04814d5
Step 2/12 : ARG GIT_REPO='https://git.sr.ht/~rjarry/aerc'
---> Using cache
---> 750ecd4efb13
Step 3/12 : COPY . /app
---> Using cache
---> 989f00ac90cd
Step 4/12 : WORKDIR app
---> Using cache
---> 3a0f58291461
Step 5/12 : RUN apk update && apk add --no-cache alpine-sdk git go scdoc w3m dante && git clone "$GIT_REPO" && cd aerc && make && make install
---> Running in 1eb525dde9b0
fetch https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
v20220715-1829-gf3fdfc94d5 [https://dl-cdn.alpinelinux.org/alpine/edge/main]
v20220715-1831-g925a7aa6fa [https://dl-cdn.alpinelinux.org/alpine/edge/community]
OK: 17367 distinct packages available
fetch https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
(1/46) Installing fakeroot (1.29-r0)
(2/46) Installing libcrypto3 (3.0.5-r1)
(3/46) Installing libssl3 (3.0.5-r1)
(4/46) Installing openssl (3.0.5-r1)
(5/46) Installing libattr (2.5.1-r1)
(6/46) Installing attr (2.5.1-r1)
(7/46) Installing libacl (2.3.1-r1)
(8/46) Installing tar (1.34-r0)
(9/46) Installing pkgconf (1.9.0-r0)
(10/46) Installing patch (2.7.6-r7)
(11/46) Installing libgcc (11.2.1_git20220219-r5)
(12/46) Installing libstdc++ (11.2.1_git20220219-r5)
(13/46) Installing lzip (1.23-r0)
(14/46) Installing ca-certificates (20220614-r1)
(15/46) Installing brotli-libs (1.0.9-r7)
(16/46) Installing nghttp2-libs (1.48.0-r1)
(17/46) Installing libcurl (7.84.0-r2)
(18/46) Installing curl (7.84.0-r2)
(19/46) Installing abuild (3.9.0-r4)
Executing abuild-3.9.0-r4.pre-install
(20/46) Installing binutils (2.38-r4)
(21/46) Installing libmagic (5.42-r0)
(22/46) Installing file (5.42-r0)
(23/46) Installing libgomp (11.2.1_git20220219-r5)
(24/46) Installing libatomic (11.2.1_git20220219-r5)
(25/46) Installing gmp (6.2.1-r2)
(26/46) Installing isl24 (0.24-r0)
(27/46) Installing mpfr4 (4.1.0-r0)
(28/46) Installing mpc1 (1.2.1-r0)
(29/46) Installing gcc (11.2.1_git20220219-r5)
(30/46) Installing musl-dev (1.2.3-r1)
(31/46) Installing libc-dev (0.7.2-r3)
(32/46) Installing g++ (11.2.1_git20220219-r5)
(33/46) Installing make (4.3-r0)
(34/46) Installing fortify-headers (1.1-r1)
(35/46) Installing build-base (0.5-r3)
(36/46) Installing libexpat (2.4.8-r1)
(37/46) Installing pcre2 (10.40-r0)
(38/46) Installing git (2.37.1-r1)
(39/46) Installing alpine-sdk (1.0-r1)
(40/46) Installing dante (1.4.3-r1)
(41/46) Installing go (1.18.5-r0)
(42/46) Installing scdoc (1.11.2-r0)
(43/46) Installing gc (8.2.0-r0)
(44/46) Installing ncurses-terminfo-base (6.3_p20220729-r0)
(45/46) Installing ncurses-libs (6.3_p20220729-r0)
(46/46) Installing w3m (0.5.3.20220429-r2)
Executing busybox-1.35.0-r18.trigger
Executing ca-certificates-20220614-r1.trigger
OK: 591 MiB in 60 packages
Cloning into 'aerc'...
go build -trimpath -ldflags "-X main.Version=0.11.0-90-gd1838c80632e -X git.sr.ht/~rjarry/aerc/config.shareDir=/usr/local/share/aerc" -o aerc
go: downloading git.sr.ht/~sircmpwn/getopt v1.0.0
go: downloading github.com/mattn/go-isatty v0.0.14
go: downloading github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778
go: downloading github.com/gdamore/tcell/v2 v2.4.0
go: downloading github.com/go-ini/ini v1.63.2
go: downloading github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
go: downloading github.com/lithammer/fuzzysearch v1.1.3
go: downloading github.com/mitchellh/go-homedir v1.1.0
go: downloading github.com/riywo/loginshell v0.0.0-20200815045211-7d26008be1ab
go: downloading github.com/emersion/go-message v0.15.0
go: downloading github.com/emersion/go-sasl v0.0.0-20211008083017-0b9dcfb154ac
go: downloading github.com/emersion/go-smtp v0.15.0
go: downloading github.com/miolini/datacounter v1.0.2
go: downloading github.com/pkg/errors v0.9.1
go: downloading golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5
go: downloading github.com/imdario/mergo v0.3.12
go: downloading github.com/kyoh86/xdg v1.2.0
go: downloading github.com/ProtonMail/go-crypto v0.0.0-20211221144345-a4f6767435ab
go: downloading github.com/emersion/go-imap v1.2.0
go: downloading github.com/gatherstars-com/jwz v1.3.0
go: downloading github.com/mattn/go-runewidth v0.0.13
go: downloading github.com/creack/pty v1.1.17
go: downloading github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964
go: downloading github.com/ddevault/go-libvterm v0.0.0-20190526194226-b7d861da3810
go: downloading github.com/emersion/go-imap-sortthread v1.2.0
go: downloading golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f
go: downloading golang.org/x/text v0.3.7
go: downloading github.com/gdamore/encoding v1.0.0
go: downloading github.com/lucasb-eyer/go-colorful v1.2.0
go: downloading golang.org/x/term v0.0.0-20210927222741-03fcf44c2211
go: downloading github.com/emersion/go-mbox v1.0.2
go: downloading github.com/emersion/go-pgpmail v0.2.0
go: downloading github.com/emersion/go-textwrapper v0.0.0-20200911093747-65d896831594
go: downloading github.com/arran4/golang-ical v0.0.0-20220517104411-fd89fefb0182
go: downloading github.com/rivo/uniseg v0.2.0
go: downloading github.com/emersion/go-msgauth v0.6.5
go: downloading github.com/ProtonMail/crypto v0.0.0-20200420072808-71bec3603bf3
go: downloading github.com/mattn/go-pointer v0.0.1
go: downloading golang.org/x/net v0.0.0-20220722155237-a158d28d115b
go: downloading github.com/syndtr/goleveldb v1.0.0
go: downloading github.com/emersion/go-maildir v0.2.0
go: downloading github.com/fsnotify/fsnotify v1.5.4
go: downloading github.com/golang/snappy v0.0.3
scdoc < doc/aerc.1.scd > aerc.1
scdoc < doc/aerc-search.1.scd > aerc-search.1
scdoc < doc/aerc-config.5.scd > aerc-config.5
scdoc < doc/aerc-imap.5.scd > aerc-imap.5
scdoc < doc/aerc-maildir.5.scd > aerc-maildir.5
scdoc < doc/aerc-sendmail.5.scd > aerc-sendmail.5
scdoc < doc/aerc-notmuch.5.scd > aerc-notmuch.5
scdoc < doc/aerc-smtp.5.scd > aerc-smtp.5
scdoc < doc/aerc-tutorial.7.scd > aerc-tutorial.7
scdoc < doc/aerc-templates.7.scd > aerc-templates.7
scdoc < doc/aerc-stylesets.7.scd > aerc-stylesets.7
mkdir -m755 -p /usr/local/bin /usr/local/share/man/man1 /usr/local/share/man/man5 /usr/local/share/man/man7 \
/usr/local/share/aerc /usr/local/share/aerc/filters /usr/local/share/aerc/templates /usr/local/share/aerc/stylesets \
/usr/local/share/applications
install -m755 aerc /usr/local/bin/aerc
install -m644 aerc.1 /usr/local/share/man/man1/aerc.1
install -m644 aerc-search.1 /usr/local/share/man/man1/aerc-search.1
install -m644 aerc-config.5 /usr/local/share/man/man5/aerc-config.5
install -m644 aerc-imap.5 /usr/local/share/man/man5/aerc-imap.5
install -m644 aerc-maildir.5 /usr/local/share/man/man5/aerc-maildir.5
install -m644 aerc-sendmail.5 /usr/local/share/man/man5/aerc-sendmail.5
install -m644 aerc-notmuch.5 /usr/local/share/man/man5/aerc-notmuch.5
install -m644 aerc-smtp.5 /usr/local/share/man/man5/aerc-smtp.5
install -m644 aerc-tutorial.7 /usr/local/share/man/man7/aerc-tutorial.7
install -m644 aerc-templates.7 /usr/local/share/man/man7/aerc-templates.7
install -m644 aerc-stylesets.7 /usr/local/share/man/man7/aerc-stylesets.7
install -m644 config/accounts.conf /usr/local/share/aerc/accounts.conf
install -m644 config/aerc.conf /usr/local/share/aerc/aerc.conf
install -m644 config/binds.conf /usr/local/share/aerc/binds.conf
install -m755 filters/calendar /usr/local/share/aerc/filters/calendar
install -m755 filters/colorize /usr/local/share/aerc/filters/colorize
install -m755 filters/hldiff /usr/local/share/aerc/filters/hldiff
install -m755 filters/html /usr/local/share/aerc/filters/html
install -m755 filters/html-unsafe /usr/local/share/aerc/filters/html-unsafe
install -m755 filters/plaintext /usr/local/share/aerc/filters/plaintext
install -m755 filters/show-ics-details.py /usr/local/share/aerc/filters/show-ics-details.py
install -m644 templates/new_message /usr/local/share/aerc/templates/new_message
install -m644 templates/quoted_reply /usr/local/share/aerc/templates/quoted_reply
install -m644 templates/forward_as_body /usr/local/share/aerc/templates/forward_as_body
install -m644 config/default_styleset /usr/local/share/aerc/stylesets/default
install -m644 contrib/aerc.desktop /usr/local/share/applications/aerc.desktop
Removing intermediate container 1eb525dde9b0
---> 5f31da7a056e
Step 6/12 : FROM alpine:edge
---> 49b6d04814d5
Step 7/12 : COPY --from=builder /usr/local/bin/aerc /usr/local/bin/aerc
---> 61c8afc20ee5
Step 8/12 : COPY --from=builder /usr/local/share/aerc /usr/local/share/aerc
---> 052f529f7748
Step 9/12 : COPY --from=builder /usr/local/share/man /usr/share/man
---> 861b01df5973
Step 10/12 : ENV EDITOR=vim
---> Running in 9db256bbcb5f
Removing intermediate container 9db256bbcb5f
---> 9b77077d296f
Step 11/12 : RUN apk add dante mandoc man-pages ncurses vim w3m
---> Running in d5ddd593a1c4
fetch https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
(1/14) Installing dante (1.4.3-r1)
(2/14) Installing man-pages (5.13-r1)
(3/14) Installing mandoc (1.14.6-r5)
(4/14) Installing ncurses-terminfo-base (6.3_p20220729-r0)
(5/14) Installing ncurses-libs (6.3_p20220729-r0)
(6/14) Installing ncurses (6.3_p20220729-r0)
(7/14) Installing xxd (9.0.0124-r0)
(8/14) Installing vim (9.0.0124-r0)
(9/14) Installing libcrypto3 (3.0.5-r1)
(10/14) Installing libgcc (11.2.1_git20220219-r5)
(11/14) Installing libstdc++ (11.2.1_git20220219-r5)
(12/14) Installing gc (8.2.0-r0)
(13/14) Installing libssl3 (3.0.5-r1)
(14/14) Installing w3m (0.5.3.20220429-r2)
Executing busybox-1.35.0-r18.trigger
OK: 57 MiB in 28 packages
Removing intermediate container d5ddd593a1c4
---> 4deb89a93b08
Step 12/12 : ENTRYPOINT ["aerc"]
---> Running in 98b89687ea14
Removing intermediate container 98b89687ea14
---> b9b7eea0831e
Successfully built b9b7eea0831e
Successfully tagged aaronkelly/aerc:latest
@Patryk27 thank you for your suggestion regarding BuildKit, I don't know much about it, but looks like it's the source of my issue
Do you have any idea why having BuildKit enabled would be causing network issues inside a container that's being built?
No idea, unfortunately :cry: docker-compose works on my machine, so I'm not sure how to go around replicating the issue
as of today.... this is no longer an issue. I can build using docker-compose build
as normal
this is life on the unstable branch, I suppose
Describe the bug
Building an image using
docker-compose build
fails due to a networking issue, files cannot be fetched from inside the container being built.Using
docker build
with the same Dockerfile is fine, there are no networking issues.Steps To Reproduce
Given this docker-compose.yml file:
Try to build an image using docker-compose, and watch it fail with
ERROR
:Build the same image using
docker build
, and watch it succeed:Expected behavior
Both
docker
anddocker-compose
should be able to build an image.Screenshots
N/A
Additional context
N/A
Notify maintainers
N/A
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.