-
Notifications
You must be signed in to change notification settings - Fork 231
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
arm64 variant of Docker image? #342
Comments
Just in case anyone else coming across this issue might find this useful, I can report that installing Faktory on an M1 Mac via Homebrew seems to succeed: $ brew install contribsys/faktory/faktory
...
$ faktory
Faktory 1.5.0
Copyright © 2021 Contributed Systems LLC
Licensed under the GNU Public License 3.0
I 2021-03-07T02:28:32.631Z Initializing redis storage at /Users/avip/.faktory/db, socket /Users/avip/.faktory/db/redis.sock
I 2021-03-07T02:28:32.644Z Web server now listening at localhost:7420
I 2021-03-07T02:28:32.644Z PID 13999 listening at localhost:7419, press Ctrl-C to stop Which is excellent! |
@mperham If you're interested in shipping docker images for multiple architectures, this article is a good primer on image manifests and the I just built and ran an arm64 faktory binary and docker image on my M1 Mac Mini using a modified diff --git a/Dockerfile b/Dockerfile
index 9499324..3731525 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,6 +1,7 @@
FROM alpine:3.13
+ARG ARCH=amd64
RUN apk add --no-cache redis ca-certificates socat
-COPY ./faktory /
+COPY ./faktory-$ARCH /faktory
RUN mkdir -p /root/.faktory/db
RUN mkdir -p /var/lib/faktory/db
diff --git a/Makefile b/Makefile
index 7f244fc..a7e10e0 100644
--- a/Makefile
+++ b/Makefile
@@ -57,6 +57,21 @@ dimg: xbuild ## Make a Docker image for the current version
--tag contribsys/faktory:latest \
.
+dimg-amd64: xbuild ## Make a Docker image for the current version (linux/amd64)
+ #eval $(shell docker-machine env default)
+ docker build \
+ --platform linux/amd64 \
+ --build-arg ARCH=amd64 \
+ --tag contribsys/faktory:$(VERSION)-amd64 \
+ .
+
+dimg-arm64: xbuild ## Make a Docker image for the current version (linux/arm64)
+ docker build\
+ --platform linux/arm64 \
+ --build-arg ARCH=arm64 \
+ --tag contribsys/faktory:$(VERSION)-arm64 \
+ .
+
drun: ## Run Faktory in a local Docker image, see also "make dimg"
docker run --rm -it -e "FAKTORY_SKIP_PASSWORD=true" \
-v faktory-data:/var/lib/faktory \
@@ -96,9 +111,12 @@ cover:
open coverage.html
xbuild: clean generate
- @GOOS=linux GOARCH=amd64 go build -o $(NAME) cmd/faktory/daemon.go
+ @GOOS=linux GOARCH=amd64 go build -o $(NAME)-amd64 cmd/faktory/daemon.go
+ @GOOS=linux GOARCH=arm64 go build -o $(NAME)-arm64 cmd/faktory/daemon.go
# brew install upx
- upx -qq ./faktory
+ upx -qq ./faktory-amd64
+ upx -qq ./faktory-arm64
build: clean generate
go build -o $(NAME) cmd/faktory/daemon.go
@@ -129,7 +147,7 @@ work: ## Run a simple Ruby worker, see also "make run"
clean: ## Clean the project, set it up for a new build
@rm -rf tmp
- @rm -f main faktory templates.go
+ @rm -f main faktory-amd64 faktory-arm64 templates.go
@rm -rf packaging/output
@mkdir -p packaging/output/upstart
@mkdir -p packaging/output/systemd Let me know if you'd like me to clean this up and put together a PR. |
@ezkl Having a PR would be wonderful. Docker is not something I'm an expert with so configuring multi-arch was a bit daunting when I looked into it recently. I'd love your help! |
It should be noted that there are ARM-native macOS binaries for v1.5.1 already for anyone who wants to run it directly: https://github.com/contribsys/faktory/releases/tag/v1.5.1-1 and of course installing via Homebrew will build the Faktory binary for your own arch. |
@mperham is this still an issue? I see |
Docker image from Docker hub, 1.5.0 (sha256:6cd4409d1ee45745835252549a3c8353cc7c84f0d5b79d921f71f58255f25ddc)
N/A
N/A
No
Yes
Hi, I’m trying to run Faktory locally on my M1 (arm64) Mac via Docker, and I get the above error message. As per docker/for-mac#5123 this is related to the Docker image being built specifically for amd64. Docker uses qemu to emulate amd64 but it doesn’t always work. That issue was closed with the guidance that the best way to support arm64 hosts is to build and publish arm64 variants of the image.
So, I’d just like to suggest that you might want to consider doing so. It might make it easier for people using M1 Macs to try out Faktory.
That said, Docker itself does not yet officially support M1 Macs (it’s a preview release) so I totally understand if you want to wait for the dust to settle a bit.
Thanks!
The text was updated successfully, but these errors were encountered: