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

ARM64 image ? #439

Closed
ErfanDL opened this issue Jul 1, 2023 · 1 comment
Closed

ARM64 image ? #439

ErfanDL opened this issue Jul 1, 2023 · 1 comment

Comments

@ErfanDL
Copy link

ErfanDL commented Jul 1, 2023

Hi, how can I build ARM64 image for docker ?

@thehilll
Copy link

thehilll commented Sep 8, 2023

This is possible with some slight modifications. I could provide a pull request, but it does break some functionality noted below).

I am running the current version with postgres on ARM, but I don't know how to get mongo to work if you want to use that. To use it with postgres:

  • Clone the repo
git clone https://github.com/alerta/docker-alerta.git
cd docker-alerta
  • As far as I can tell the version of mongodb-org-shell used (4.2) does not have a pre-built binary for ARM64. I have found instructions to build it yourself, but that's a larger change to the Dockerfile. It also might be possible to use a newer version which I believe does have a pre-built ARM version, but I don't know.
  • Because I'm not using mongo I just commented out the lines in the Dockerfile and in docker-entrypoint.sh that depend on it:
diff --git a/Dockerfile b/Dockerfile
index 351ea18..044dc5d 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -63,14 +63,14 @@ RUN curl -fsSL https://nginx.org/keys/nginx_signing.key | apt-key add - && \
     rm -rf /var/lib/apt/lists/*

 # hadolint ignore=DL3008
-RUN curl -fsSL https://www.mongodb.org/static/pgp/server-4.2.asc | apt-key add - && \
-    echo "deb https://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 main" | tee /etc/apt/sources.list.d/mongodb-org-4.2.list && \
-    apt-get update && \
-    apt-get install -y --no-install-recommends \
-    mongodb-org-shell && \
-    apt-get -y clean && \
-    apt-get -y autoremove && \
-    rm -rf /var/lib/apt/lists/*
+#RUN curl -fsSL https://www.mongodb.org/static/pgp/server-4.2.asc | apt-key add - && \
+#    echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 main" | tee /etc/apt/sources.list.d/mongodb-org-4.2.list && \
+#    apt-get update && \
+#    apt-get install -y --no-install-recommends \
+#    mongodb-org-shell && \
+#    apt-get -y clean && \
+#    apt-get -y autoremove && \
+#    rm -rf /var/lib/apt/lists/*

 COPY requirements*.txt /app/
 # hadolint ignore=DL3013
diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh
index 1f3cd8a..bdd3d24 100755
--- a/docker-entrypoint.sh
+++ b/docker-entrypoint.sh
@@ -89,7 +89,7 @@ echo Alerta WebUI  ${WEBUI_VERSION}

 nginx -v
 echo uwsgi $(uwsgi --version)
-mongo --version | grep MongoDB
+#mongo --version | grep MongoDB
 psql --version
 python3 --version
 /venv/bin/pip list
  • You can then build an image by specifying the platform to be ARM:
docker build \
  --platform=linux/arm64/v8 \
  --build-arg VCS_REF=(git rev-parse --short HEAD) \
  --build-arg BUILD_DATE=(date -u +"%Y-%m-%dT%H:%M:%SZ") \
  --build-arg VERSION=(cat VERSION) \
  -t alerta-web:20230906 .
  • You will now have this image on your machine, but you need to create a docker-compose.override.yml to use it rather than the one specified in docker-compose.yml:
version: '2.1'
services:
  web:
    image: alerta-web:20230906
  • At this point you can proceed as the README says:
docker-compose up -d

# and to see what is happening:
docker logs -f alerta_web_1

@satterly satterly closed this as completed Apr 9, 2024
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

3 participants