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

registry image won't run on arm64v8 #78

Open
milovanderlinden opened this issue Aug 24, 2018 · 8 comments
Open

registry image won't run on arm64v8 #78

milovanderlinden opened this issue Aug 24, 2018 · 8 comments

Comments

@milovanderlinden
Copy link

I am trying to install registry on a Raspberry Pi 3 B + running the arm64v8 version of hypriot. The registry will not run.

Docker info

Containers: 1
 Running: 0
 Paused: 0
 Stopped: 1
Images: 1
Server Version: 18.04.0-ce
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host ipvlan macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 773c489c9c1b21a6d78b5c538cd395416ec50f88
runc version: 4fc53a81fb7c994640722ac585fa9ca548971871
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.14.37-hypriotos-v8
Operating System: Debian GNU/Linux 9 (stretch)
OSType: linux
Architecture: aarch64
CPUs: 4
Total Memory: 969MiB
Name: black-pearl
ID: xxxx
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
 os=linux
 arch=arm64
Experimental: true
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

WARNING: No memory limit support
WARNING: No swap limit support
WARNING: No kernel memory limit support
WARNING: No oom kill disable support

I first tried to run:

docker run -d -p 5000:5000 --restart always --name registry registry
Unable to find image 'registry:latest' locally
latest: Pulling from library/registry
docker: no matching manifest for linux/arm64 in the manifest list entries.
See 'docker run --help'.

Noticed on hub.docker.com that there is a registry for aarch64 and tried:

docker run --platform linux/aarch64 -d -p 5000:5000 --restart always --name registry registry
Unable to find image 'registry:latest' locally
docker: Error response from daemon: invalid platform: invalid platform architecture "aarch64".
See 'docker run --help'.
@milovanderlinden
Copy link
Author

I managed to build the image:

git clone https://github.com/docker/distribution-library-image.git
Cloning into 'distribution-library-image'...
remote: Counting objects: 142, done.
remote: Total 142 (delta 0), reused 0 (delta 0), pack-reused 142
Receiving objects: 100% (142/142), 85.87 MiB | 1.47 MiB/s, done.
Resolving deltas: 100% (44/44), done.
HypriotOS/arm64: pirate@black-pearl in ~
$ cd distribution-library-image/
HypriotOS/arm64: pirate@black-pearl in ~/distribution-library-image
$ nano Dockerfile 
HypriotOS/arm64: pirate@black-pearl in ~/distribution-library-image
$ docker build -t registry .
Sending build context to Docker daemon  112.9MB
Step 1/9 : FROM alpine:latest
latest: Pulling from library/alpine
47e04371c990: Pull complete 
b4103359e1ec: Pull complete 
Digest: sha256:7043076348bf5040220df6ad703798fd8593a0918d06d3ce30c6c93be117e430
Status: Downloaded newer image for alpine:latest
 ---> def91cb894ef
Step 2/9 : RUN set -ex     && apk add --no-cache ca-certificates apache2-utils
 ---> Running in ef50d9b64903
+ apk add --no-cache ca-certificates apache2-utils
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/aarch64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/aarch64/APKINDEX.tar.gz
(1/6) Installing libuuid (2.32-r0)
(2/6) Installing apr (1.6.3-r1)
(3/6) Installing expat (2.2.5-r0)
(4/6) Installing apr-util (1.6.1-r2)
(5/6) Installing apache2-utils (2.4.34-r0)
(6/6) Installing ca-certificates (20171114-r3)
Executing busybox-1.28.4-r0.trigger
Executing ca-certificates-20171114-r3.trigger
OK: 6 MiB in 19 packages
Removing intermediate container ef50d9b64903
 ---> bec21f35ceb9
Step 3/9 : COPY ./registry/registry /bin/registry
 ---> 9101703cf208
Step 4/9 : COPY ./registry/config-example.yml /etc/docker/registry/config.yml
 ---> f278fdc8ece1
Step 5/9 : VOLUME ["/var/lib/registry"]
 ---> Running in b2c34c3fef47
Removing intermediate container b2c34c3fef47
 ---> c94d80f0e5a7
Step 6/9 : EXPOSE 5000
 ---> Running in db06ae8b4d92
Removing intermediate container db06ae8b4d92
 ---> f0d3ef1a2564
Step 7/9 : COPY docker-entrypoint.sh /entrypoint.sh
 ---> 37fc8f19656a
Step 8/9 : ENTRYPOINT ["/entrypoint.sh"]
 ---> Running in 3dad21b1cede
Removing intermediate container 3dad21b1cede
 ---> 08790a9a4615
Step 9/9 : CMD ["/etc/docker/registry/config.yml"]
 ---> Running in 87f5fe0a527f
Removing intermediate container 87f5fe0a527f
 ---> ed895648754c
Successfully built ed895648754c
Successfully tagged registry:latest

@stevvooe
Copy link
Contributor

invalid platform architecture "aarch64".

Looks like the image is reporting the incorrect platform.

@tianon Any ideas here?

@milovanderlinden
Copy link
Author

Unfortunatly the registry keeps restarting

docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                         PORTS               NAMES
7b4cc8ec0fa5        registry            "/entrypoint.sh /etc…"   36 seconds ago      Restarting (2) 7 seconds ago                       registry

A look at the log shows

docker logs registry
/bin/registry: line 2: syntax error: unexpected word (expecting ")")
/bin/registry: line 2: syntax error: unexpected word (expecting ")")
/bin/registry: line 2: syntax error: unexpected word (expecting ")")

It seems as if the binary in ~/distribution-library-image/registry/registry
is not arm64 compatible.

@MonkeySK
Copy link

MonkeySK commented Sep 6, 2018

Hi, here was what I did :
1st: change the base image, which means the image will be bigger than before;

FROM alpine

FROM centos:7

2nd: down load the registry source;
git clone https://github.com/docker/distribution.git

3rd: build registry,and the registry binary file will be created in ./bin/ directory.
make

4th: replace the registry binary file of this project'

5th: rebuild the registry image use this project Dockerfile;
MAYBE TRY!

@gwh-cpnet
Copy link

I just wonder why this repo is not multi-arch supported.

@tianon
Copy link
Contributor

tianon commented Sep 12, 2018

invalid platform architecture "aarch64".

Looks like the image is reporting the incorrect platform.

@tianon Any ideas here?

This specific error looks more to me like a misconfigured daemon or client -- aarch64 shouldn't ever be a platform specifier for Docker images (that'd be arm64 instead).

I think the crux of this issue is really a duplicate of #54 (the registry image doesn't support arm64 right now, and the binary that's included in this repo is a pre-compiled amd64 binary that thus will not and cannot work on arm64 as-is, which is all relevant discussion to have over at #54).

@rhrn
Copy link

rhrn commented Nov 12, 2018

Like workaround, you can use builded image or build from source by self.

Build
https://hub.docker.com/r/rhrn/arm64v8-registry/

Source
https://github.com/rhrn/arm64v8-registry

@milovanderlinden
Copy link
Author

Thanks guys, great work. I prefer alpine over centos because of size.

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