docker / docker/cli

docker-cli build container failed in zLinux (s390x) due to incorrect build logic in configuring repositories.

Open
#3,822 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/packaging kind/bug
Dominant language
Go
Stars
6.1k
Forks
2.2k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

Description

Hello!

I detected one problem in build logic. If you try to build docker-cli using this repo (branch 20.10 but 22.06 also affected) there are critical errors preventing build stage from dev-container. The reason is just no lld package in Alpine Linux repositories in versions using in build container (3.16). It can be checked by s390x arch using search in https://pkgs.alpinelinux.org/packages. I used docker.io package from debian to build docker-cli, but there are no difference because problem actually in build logic.

I applied easy workaround by adding old repository which contains needed package in s390x (branch 3.14) to configuration file of apk repositories. So I performed following modification to Dockerfile. So this problem was fixed.

# 11 string in Dockerfile
RUN echo "https://dl-cdn.alpinelinux.org/alpine/v3.14/community" >> /etc/apk/repositories && apk add --no-cache clang lld llvm file git

I suggest to add some checks in build container to search actually available packages for selected arch and generate appropriate repositories configuration entries in Alpine Linux.

Hope my investigation helps to the project.

Reproduce
git clone -b 20.10 https://github.com/docker/cli.git ./docker-client
cd ./docker-client

docker buildx bake --set binary.platform=linux/s390x

I am always get output:

fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/main/s390x/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/community/s390x/APKINDEX.tar.gz
ERROR: unable to select packages:
  lld (no such package):
    required by: world[lld]

The same result can be reproduced by entering build container shell manually and test problem step with install packages (lld not found).

make -f docker.Makefile shell
> apk add --no-cache clang lld llvm file git

fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/main/s390x/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/community/s390x/APKINDEX.tar.gz
ERROR: unable to select packages:
  lld (no such package):
    required by: world[lld]
Expected behavior

docker buildx bake --set binary.platform=linux/s390x should lead to successful build of docker cli binary without errors.

docker version
Client:
 Version:           20.10.5+dfsg1
 API version:       1.41
 Go version:        go1.15.15
 Git commit:        55c4c88
 Built:             Mon May 30 18:34:49 2022
 OS/Arch:           linux/s390x
 Context:           default
 Experimental:      true
docker info
Client:                                                                                                                                                                      
 Context:    default                                                                                                                                                         
 Debug Mode: false                                                                                                                                                           
 Plugins:                                                                                                                                                                    
  buildx: Docker Buildx (Docker Inc., v0.9.1)                                                                                                                                
                                                                                                                                                                             
Server:                                                                                                                                                                      
 Containers: 0                                                                                                                                                               
  Running: 0                                                                                                                                                                 
  Paused: 0                                                                                                                                                                  
  Stopped: 0                                                                                                                                                                 
 Images: 4                                                                                                                                                                   
 Server Version: dev                                                                                                                                                         
 Storage Driver: overlay2                                                                                                                                                    
  Backing Filesystem: extfs                                                                                                                                                  
  Supports d_type: true                                                                                                                                                      
  Native Overlay Diff: true                                                                                                                                                  
  userxattr: false                                                                                                                                                           
 Logging Driver: json-file                                                                                                                                                   
 Cgroup Driver: systemd                                                                                                                                                      
 Cgroup Version: 2                                                                                                                                                           
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc io.containerd.runc.v2 io.containerd.runtime.v1.linux
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 1.4.13~ds1-1~deb11u2
 runc version: v1.1.4-0-g5fd4c4d1
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: default
  cgroupns
 Kernel Version: 5.10.0-18-s390x
 Operating System: Debian GNU/Linux 11 (bullseye)
 OSType: linux
 Architecture: s390x
 CPUs: 2
 Total Memory: 7.849GiB
 Name: vm53-debian-1105.kvm
 ID: 3HR5:TSBC:5FFX:CVSB:6ZR4:KKPF:K7C4:BGIQ:LLSL:3NMV:VQ4A:JDDY
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http://172.26.106.31:3128/
 HTTPS Proxy: http://172.26.106.31:3128/
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false


### Additional Info

build docker in zLinux:
OS: Debian 11.5 (kvm guest) s390x
Virtualization: KVM host with OpenSUSE 15.3 Leap on dedicated LPAR.
Top level Hardware: LPAR in Mainframe Z15

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Dockerfile line 11 and the repository configuration used by docker buildx bake for linux/s390x. Reproduce the failure with docker buildx bake --set binary.platform=linux/s390x, then compare it with make -f docker.Makefile shell and the failing apk install. Done means the s390x Docker CLI build completes without the missing lld package error.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
build-system, cli, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.