Skip to content

Commit

Permalink
build(container): Use ${variable:?} syntax to avoid creation of inv…
Browse files Browse the repository at this point in the history
…alid images.
  • Loading branch information
KirilMihaylov committed Sep 30, 2024
1 parent f33f6ab commit 134f23f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,21 @@ FROM compiled-base AS compiled

ARG package

LABEL "package"="${package}"
LABEL "package"="${package:?}"

ARG profile

LABEL "profile"="${profile}"
LABEL "profile"="${profile:?}"

COPY --chown="0":"0" --chmod="0555" "." "/code/"

RUN "cargo" \
"rustc" \
"--bin" "${package}" \
"--bin" "${package:?}" \
"--locked" \
"--manifest-path" "/code/services/${package}/Cargo.toml" \
"--package" "${package}" \
"--profile" "${profile}" \
"--manifest-path" "/code/services/${package:?}/Cargo.toml" \
"--package" "${package:?}" \
"--profile" "${profile:?}" \
"--target" "x86_64-unknown-linux-gnu" \
"--target-dir" "/build-output/" \
"--" \
Expand All @@ -79,14 +79,14 @@ FROM ${package}-base AS service

ARG package

LABEL "package"="${package}"
LABEL "package"="${package:?}"

ARG profile

LABEL "profile"="${profile}"
LABEL "profile"="${profile:?}"

ARG profile_output_dir

COPY --from=compiled --chown="0":"0" --chmod="0100" \
"/build-output/x86_64-unknown-linux-gnu/${profile_output_dir}/${package}" \
"/build-output/x86_64-unknown-linux-gnu/${profile_output_dir:?}/${package:?}" \
"/service/service"

0 comments on commit 134f23f

Please sign in to comment.