Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apk add not working on building buildx #110

Closed
SaturnusDJ opened this issue Jul 20, 2019 · 13 comments
Closed

Apk add not working on building buildx #110

SaturnusDJ opened this issue Jul 20, 2019 · 13 comments

Comments

@SaturnusDJ
Copy link

Cloning git

# git clone git://github.com/docker/buildx && cd buildx
Cloning into 'buildx'...
remote: Enumerating objects: 15, done.
remote: Counting objects: 100% (15/15), done.
remote: Compressing objects: 100% (15/15), done.
remote: Total 5065 (delta 0), reused 4 (delta 0), pack-reused 5050
Receiving objects: 100% (5065/5065), 5.70 MiB | 9.00 MiB/s, done.
Resolving deltas: 100% (1618/1618), done.

Installing

# make install
./hack/binaries
+ progressFlag=
+ '[' '' == true ']'
+ case $buildmode in
+ binariesDocker
+ mkdir -p bin/tmp
+ export DOCKER_BUILDKIT=1
+ DOCKER_BUILDKIT=1
++ mktemp -t docker-iidfile.XXXXXXXXXX
+ iidfile=/tmp/docker-iidfile.DBjShhbJPS
+ platformFlag=
+ '[' -n '' ']'
+ docker build --target=binaries --iidfile /tmp/docker-iidfile.DBjShhbJPS --force-rm .
[+] Building 12.9s (14/17)
 => [internal] load build definition from Dockerfile                                                                         0.0s
 => => transferring dockerfile: 3.01kB                                                                                       0.0s
 => [internal] load .dockerignore                                                                                            0.0s
 => => transferring context: 56B                                                                                             0.0s
 => resolve image config for docker.io/docker/dockerfile:1.1-experimental                                                    1.2s
 => CACHED docker-image://docker.io/docker/dockerfile:1.1-experimental@sha256:9022e911101f01b2854c7a4b2c77f524b998891941da5  0.0s
 => [internal] load build definition from Dockerfile                                                                         0.0s
 => => transferring dockerfile: 3.01kB                                                                                       0.0s
 => [internal] load .dockerignore                                                                                            0.0s
 => [internal] load metadata for docker.io/tonistiigi/xx:golang@sha256:6f7d999551dd471b58f70716754290495690efa8421e0a1fcf18  0.0s
 => [internal] load metadata for docker.io/library/golang:1.12-alpine                                                        0.4s
 => CACHED [xgo 1/1] FROM docker.io/tonistiigi/xx:golang@sha256:6f7d999551dd471b58f70716754290495690efa8421e0a1fcf18eb11d0c  0.0s
 => CACHED [internal] helper image for file operations                                                                       0.0s
 => [gobase 1/3] FROM docker.io/library/golang:1.12-alpine@sha256:87e527712342efdb8ec5ddf2d57e87de7bd4d2fedf9f6f3547ee5768b  0.0s
 => [internal] load build context                                                                                            0.7s
 => => transferring context: 29.64MB                                                                                         0.7s
 => CACHED [gobase 2/3] COPY --from=xgo / /                                                                                  0.0s
 => ERROR [gobase 3/3] RUN apk add --no-cache file git                                                                      10.7s
------
 > [gobase 3/3] RUN apk add --no-cache file git:
#13 0.526 fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/main/x86_64/APKINDEX.tar.gz
#13 5.534 fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/community/x86_64/APKINDEX.tar.gz
#13 5.534 WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/v3.10/main/x86_64/APKINDEX.tar.gz: temporary error (try again later)
#13 10.54 WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/v3.10/community/x86_64/APKINDEX.tar.gz: temporary error (try again later)
#13 10.54 ERROR: unsatisfiable constraints:
#13 10.54   file (missing):
#13 10.54     required by: world[file]
#13 10.54   git (missing):
#13 10.54     required by: world[git]
------
rpc error: code = Unknown desc = executor failed running [/bin/sh -c apk add --no-cache file git]: exit code: 2
Makefile:5: recipe for target 'binaries' failed
make: *** [binaries] Error 1

Docker version

# docker version
Client:
 Version:           18.09.7
 API version:       1.39
 Go version:        go1.10.1
 Git commit:        2d0083d
 Built:             Wed Jul  3 12:13:59 2019
 OS/Arch:           linux/amd64
 Experimental:      true

Server:
 Engine:
  Version:          18.09.7
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.1
  Git commit:       2d0083d
  Built:            Mon Jul  1 19:31:12 2019
  OS/Arch:          linux/amd64
  Experimental:     true

The apk command also fails when DOCKER_CLI_EXPERIMENTAL and DOCKER_BUILDKIT are enabled in env and trying to build images.

Building non experimental works fine.

@FernandoMiguel
Copy link
Contributor

i'm seeing something similar in
#109
but in my case, i am using run cache

@SaturnusDJ
Copy link
Author

@FernandoMiguel
I saw your topic before and got the idea of trying without any 'cache argument'. Same outcome. Might still be related indeed though.

@FernandoMiguel
Copy link
Contributor

@SaturnusDJ see this
moby/buildkit#1009 (comment)
i've changed my dockerfiles and am right now doing a jenkins run to see if it works

@FernandoMiguel
Copy link
Contributor

ignore my now deleted comment... i had a duplicate symlink

@SaturnusDJ
Copy link
Author

@FernandoMiguel
Thanks for the info.
Though, I don't understand why that would fix it. I will post in that topic.

@FernandoMiguel
Copy link
Contributor

after that change, my issue is fixed @SaturnusDJ

@tonistiigi
Copy link
Member

@SaturnusDJ Does your setup require using a custom DNS configuration?

@SaturnusDJ
Copy link
Author

@tonistiigi
No DNS or any other network configuration required.
I do block Google DNS in the network but assume those are not used by Alpine or apk software.

@FernandoMiguel
Copy link
Contributor

@tonistiigi
No DNS or any other network configuration required.
I do block Google DNS in the network but assume those are not used by Alpine or apk software.

i wouldn't be so sure.
actually, i've seen many docker images and even docker agents default to 8.8.8.8

@FernandoMiguel
Copy link
Contributor

btw, make sure you nuke your builder cache.
I had problems with once it failed, and never working again until i cleared the cache.
after that worked fine

@SaturnusDJ
Copy link
Author

Hmm it all works when using the non experimental build command.
I am using --no-cache always.

@tonistiigi
Copy link
Member

Most likely this is related to moby/buildkit#1033 . Need to add custom config support for buildx so external dns can be configured.

@crazy-max
Copy link
Member

Closing for housekeeping. Cannot reproduce but let us know if it still happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants