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

"error: unexpected" when use docker image on Rasperry pi 4 #2418

Closed
tulequ opened this issue Nov 2, 2021 · 6 comments
Closed

"error: unexpected" when use docker image on Rasperry pi 4 #2418

tulequ opened this issue Nov 2, 2021 · 6 comments

Comments

@tulequ
Copy link

tulequ commented Nov 2, 2021

Describe the bug
can't use arm64 docker image on rasperry pi 4

System Setup

  • Command:
$ docker run --rm -it chrislusf/seaweedfs
/usr/bin/weed: line 1: syntax error: unexpected "("

$ docker run --rm -it chrislusf/seaweedfs:2.76
/usr/bin/weed: line 1: syntax error: unexpected end of file (expecting ")")

# but if I download linux_arm64 then mount to docker, it will success
$ docker run --rm -it -v $HOME/weed:/usr/bin/weed chrislusf/seaweedfs
SeaweedFS: store billions of files and serve them fast!
...
  • OS version: raspbian 10.10

Expected behavior
Should working on rasperry pi 4

@chrislusf
Copy link
Collaborator

Can not help much since I do not have access to rasperry pi.

Seems it was trying to execute https://github.com/chrislusf/seaweedfs/blob/master/docker/entrypoint.sh

@tulequ
Copy link
Author

tulequ commented Nov 3, 2021

ok, I will try debug myself and update later
Does the image build from this file https://github.com/chrislusf/seaweedfs/blob/master/docker/Dockerfile?

But it happen when I run the binary file, not the entrypoint.sh

@chrislusf
Copy link
Collaborator

@tulequ
Copy link
Author

tulequ commented Nov 4, 2021

$ docker run --rm -it --entrypoint sh chrislusf/seaweedfs
/ # apk add file
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/main/aarch64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/community/aarch64/APKINDEX.tar.gz
(1/2) Installing libmagic (5.40-r1)
(2/2) Installing file (5.40-r1)
Executing busybox-1.33.1-r3.trigger
OK: 13 MiB in 18 packages
/ # file /usr/bin/weed
/usr/bin/weed: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=y82yWKl36bY4Y2fhucPf/Z4wobYZqXuJnr64adh1D/_e5Rbtdaox_5jEJilw8f/GXs8RisRZKL2vjX8LX4N, not stripped
/ # file /bin/busybox
/bin/busybox: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-aarch64.so.1, stripped
/ #

maybe something wrong with build process, it output x86-64 execute, it must be aarch64

@tulequ
Copy link
Author

tulequ commented Nov 4, 2021

FROM amd64/golang:1.17-alpine as builder

I don't know why use amd64 here? or we must set GOARCH?

@chrislusf
Copy link
Collaborator

Thanks for debugging! Added a fix.

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

2 participants