33# Torrust Tracker
44
55# # Builder Image
6- FROM docker.io/library/rust:bookworm as chef
6+ FROM docker.io/library/rust:bookworm AS chef
77WORKDIR /tmp
88RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
99RUN cargo binstall --no-confirm cargo-chef cargo-nextest
1010
1111# # Tester Image
12- FROM docker.io/library/rust:slim-bookworm as tester
12+ FROM docker.io/library/rust:slim-bookworm AS tester
1313WORKDIR /tmp
1414
1515RUN apt-get update; apt-get install -y curl sqlite3; apt-get autoclean
@@ -21,7 +21,7 @@ RUN mkdir -p /app/share/torrust/default/database/; \
2121 sqlite3 /app/share/torrust/default/database/tracker.sqlite3.db "VACUUM;"
2222
2323# # Su Exe Compile
24- FROM docker.io/library/gcc:bookworm as gcc
24+ FROM docker.io/library/gcc:bookworm AS gcc
2525COPY ./contrib/dev-tools/su-exec/ /usr/local/src/su-exec/
2626RUN cc -Wall -Werror -g /usr/local/src/su-exec/su-exec.c -o /usr/local/bin/su-exec; chmod +x /usr/local/bin/su-exec
2727
@@ -62,7 +62,7 @@ RUN cargo nextest archive --tests --benches --examples --workspace --all-targets
6262
6363
6464# Extract and Test (debug)
65- FROM tester as test_debug
65+ FROM tester AS test_debug
6666WORKDIR /test
6767COPY . /test/src/
6868COPY --from=build_debug \
@@ -76,7 +76,7 @@ RUN mkdir /app/lib/; cp -l $(realpath $(ldd /app/bin/torrust-tracker | grep "lib
7676RUN chown -R root:root /app; chmod -R u=rw,go=r,a+X /app; chmod -R a+x /app/bin
7777
7878# Extract and Test (release)
79- FROM tester as test
79+ FROM tester AS test
8080WORKDIR /test
8181COPY . /test/src
8282COPY --from=build \
@@ -91,7 +91,7 @@ RUN chown -R root:root /app; chmod -R u=rw,go=r,a+X /app; chmod -R a+x /app/bin
9191
9292
9393# # Runtime
94- FROM gcr.io/distroless/cc-debian12:debug as runtime
94+ FROM gcr.io/distroless/cc-debian12:debug AS runtime
9595RUN ["/busybox/cp" , "-sp" , "/busybox/sh" ,"/busybox/cat" ,"/busybox/ls" ,"/busybox/env" , "/bin/" ]
9696COPY --from=gcc --chmod=0555 /usr/local/bin/su-exec /bin/su-exec
9797
@@ -129,14 +129,14 @@ ENTRYPOINT ["/usr/local/bin/entry.sh"]
129129
130130
131131# # Torrust-Tracker (debug)
132- FROM runtime as debug
132+ FROM runtime AS debug
133133ENV RUNTIME="debug"
134134COPY --from=test_debug /app/ /usr/
135135RUN env
136136CMD ["sh" ]
137137
138138# # Torrust-Tracker (release) (default)
139- FROM runtime as release
139+ FROM runtime AS release
140140ENV RUNTIME="release"
141141COPY --from=test /app/ /usr/
142142HEALTHCHECK --interval=5s --timeout=5s --start-period=3s --retries=3 \
0 commit comments