amazeeio / docker-haproxy

Check the updated version at https://github.com/pygmystack/haproxy
https://github.com/pygmystack/haproxy
8 stars 10 forks source link

Continuously restarting on M1 Mac #11

Closed BrianGilbert closed 1 year ago

BrianGilbert commented 3 years ago

When I run pygmy up I get the following, other caontainers work but amazeeio-haptroxy just continuously in a restarting loop

pygmy up
Successfully started dnsmasq
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Successfully started haproxy
Successfully created amazeeio network
Successfully connected haproxy to amazeeio network
Successfully started mailhog
Successfully started ssh-agent
setting up DNS resolution and loopback alias IP, this may require sudo
Successfully configured local resolver
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Identity added: [edited])
Successfully injected ssh key
tobybellwood commented 3 years ago

Yup, sorry! - we're actively working on an update right now that builds arm-compatible images

duttonw commented 2 years ago

@BrianGilbert , I've found work around

need to update to 0.8.0 and make multi architecture docker images based on pulling a differnt docker-gen version. docker-gen-alpine-linux-amd64-0.8.0.tar.gz docker-gen-alpine-linux-arm64-0.8.0.tar.gz

As a workaround, do these changes to this repo below, then run run docker-compose up --build

diff --git a/Dockerfile b/Dockerfile
index 6ff7da0..d1fccd9 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -2,9 +2,10 @@ FROM haproxy:1.7-alpine
 RUN apk update && apk --no-cache add bash
-ENV DOCKER_GEN_VERSION 0.7.3
+ENV DOCKER_GEN_VERSION 0.8.0
-ADD https://github.com/jwilder/docker-gen/releases/download/$DOCKER_GEN_VERSION/docker-gen-linux-amd64-$DOCKER_GEN_VERSION.tar.gz /tmp/docker-gen.tar.gz
+#ADD https://github.com/jwilder/docker-gen/releases/download/$DOCKER_GEN_VERSION/docker-gen-linux-amd64-$DOCKER_GEN_VERSION.tar.gz /tmp/docker-gen.tar.gz
+ADD https://github.com/jwilder/docker-gen/releases/download/$DOCKER_GEN_VERSION/docker-gen-linux-arm64-$DOCKER_GEN_VERSION.tar.gz /tmp/docker-gen.tar.gz
 RUN tar -C /usr/local/bin -xvzf /tmp/docker-gen.tar.gz && \
chmod +x /usr/local/bin/docker-gen
diff --git a/docker-compose.yml b/docker-compose.yml
index ce7b2b5..7590297 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -8,4 +8,12 @@ services:
ports:
- 80:80
- 443:443
- network_mode: bridge
\ No newline at end of file
+ #network_mode: bridge
+ networks:
+ - amazeeio-network
+ - default
+
+networks:
+ amazeeio-network:
+ external: true
duttonw commented 2 years ago

seems https://github.com/amazeeio/docker-haproxy/pull/9 is the closest to fixing this overall.

tobybellwood commented 2 years ago

We've actually just fixed this in the replacement docker-haproxy service (https://github.com/pygmystack/haproxy).

This won't be backported to the current amazeeio/pygmy (it's no longer able to be maintained in a future-compatible way) - so we suggest using github.com/fubarhouse/pygmy-go as a drop-in replacement (M1 compatible release to come this week)