-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: switch to build args over env vars in dockerfile
`--env` is a podman-specific feature. While it is clear that podman is a requirement here, switching these to build arguments better expresses intent. These values are meant to be configurable at build time, which is exactly what build arguments are for, while environment variables are meant to persist in the image built. Additionally, this removes unused env vars. Signed-off-by: Yorgos Saslis <[email protected]>
- Loading branch information
1 parent
a4e0d21
commit 730f7ae
Showing
2 changed files
with
18 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,11 @@ LABEL maintainer="Radicle Team <[email protected]>" | |
WORKDIR /src | ||
COPY . . | ||
|
||
ARG TZ | ||
ARG LC_ALL | ||
ARG SOURCE_DATE_EPOCH | ||
ARG RADICLE_VERSION | ||
|
||
# Copy cargo configuration we're going to use to specify compiler options. | ||
RUN mkdir -p .cargo && cp build/config.toml .cargo/config.toml | ||
# Install dependencies. | ||
|
@@ -49,6 +54,10 @@ RUN cargo zigbuild --locked --release \ | |
# Now copy the files to a new image without all the intermediary artifacts to | ||
# save some space. | ||
FROM alpine:3.19 as packager | ||
|
||
ARG RADICLE_VERSION | ||
ARG SOURCE_DATE_EPOCH | ||
|
||
COPY --from=builder \ | ||
/src/target/x86_64-unknown-linux-musl/release/rad-web \ | ||
/src/target/x86_64-unknown-linux-musl/release/radicle-httpd \ | ||
|
@@ -77,7 +86,7 @@ RUN find * -maxdepth 0 -type d -exec mv '{}' "radicle-$RADICLE_VERSION-{}" \; && | |
find * -maxdepth 0 -type d -exec tar \ | ||
--sort=name \ | ||
--verbose \ | ||
--mtime="@$GIT_COMMIT_TIME" \ | ||
--mtime="@$SOURCE_DATE_EPOCH" \ | ||
--owner=0 \ | ||
--group=0 \ | ||
--numeric-owner \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters