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

[docker-compose] Improper syntax in apps/docker/Dockerfile #20423

Open
hobbes1069 opened this issue Nov 2, 2024 · 0 comments
Open

[docker-compose] Improper syntax in apps/docker/Dockerfile #20423

hobbes1069 opened this issue Nov 2, 2024 · 0 comments
Labels
Platform-Docker Docker related

Comments

@hobbes1069
Copy link

Current Behaviour

While I'm trying to get things going using podman-compose it looks like the problem I ran into shouldn't be working with docker-compose either.

Per the docker documentation[1], ARG scope is lost on subsequence FROM statements and:

ARG USER_ID=1000
ARG GROUP_ID=1000
ARG DOCKER_USER=acore

Is only referenced in the skeleton part of the Dockerfile. This was causing USER_ID, GROUP_ID, and DOCKER_USER to not get substituted.

Expected Blizzlike Behaviour

Images are built without error.

Source

https://docs.docker.com/reference/dockerfile/#understand-how-arg-and-from-interact

Steps to reproduce the problem

Try to use podman-compose

Extra Notes

No response

AC rev. hash/commit

N/A

Operating system

Fedora 40

Custom changes or Modules

$ git diff apps/docker/Dockerfile
diff --git a/apps/docker/Dockerfile b/apps/docker/Dockerfile
index e003ae8..7fa27a8 100644
--- a/apps/docker/Dockerfile
+++ b/apps/docker/Dockerfile
@@ -1,5 +1,8 @@
ARG UBUNTU_VERSION=22.04 # lts
ARG TZ=Etc/UTC
+ARG USER_ID=1000
+ARG GROUP_ID=1000
+ARG DOCKER_USER=acore

This target lays out the general directory skeleton for AzerothCore,

This target isn't intended to be directly used

@@ -108,9 +111,9 @@ RUN --mount=type=cache,target=/ccache,sharing=locked \

FROM skeleton AS runtime

-ARG USER_ID=1000
-ARG GROUP_ID=1000
-ARG DOCKER_USER=acore
+ARG USER_ID
+ARG GROUP_ID
+ARG DOCKER_USER

ENV ACORE_COMPONENT=undefined

@@ -154,6 +157,10 @@ ENV AC_UPDATES_ENABLE_DATABASES=0
ENV AC_DISABLE_INTERACTIVE=1
ENV AC_CLOSE_IDLE_CONNECTIONS=0

+ARG USER_ID
+ARG GROUP_ID
+ARG DOCKER_USER
+
COPY --chown=$DOCKER_USER:$DOCKER_USER
--from=build
/azerothcore/env/dist/bin/authserver /azerothcore/env/dist/bin/authserver
@@ -176,6 +183,10 @@ ENV AC_UPDATES_ENABLE_DATABASES=0
ENV AC_DISABLE_INTERACTIVE=1
ENV AC_CLOSE_IDLE_CONNECTIONS=0

+ARG USER_ID
+ARG GROUP_ID
+ARG DOCKER_USER
+
COPY --chown=$DOCKER_USER:$DOCKER_USER
--from=build
/azerothcore/env/dist/bin/worldserver /azerothcore/env/dist/bin/worldserver
@@ -192,6 +203,7 @@ FROM runtime AS db-import

LABEL description="AzerothCore Database Import tool"

+ARG DOCKER_USER
USER $DOCKER_USER

ENV ACORE_COMPONENT=dbimport
@@ -222,6 +234,7 @@ RUN apt-get update &&
apt-get install -y curl unzip &&
rm -rf /var/lib/apt/lists/*

+ARG DOCKER_USER
COPY --chown=$DOCKER_USER:$DOCKER_USER apps apps

VOLUME /azerothcore/env/dist/data
@@ -246,6 +259,7 @@ RUN mkdir -pv /azerothcore/env/dist/Cameras
/azerothcore/env/dist/mmaps
/azerothcore/env/dist/vmaps

+ARG DOCKER_USER
COPY --chown=$DOCKER_USER:$DOCKER_USER --from=build
/azerothcore/env/dist/bin/map_extractor /azerothcore/env/dist/bin/map_extractor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform-Docker Docker related
Projects
None yet
Development

No branches or pull requests

2 participants