Skip to content

Commit

Permalink
#162 simplify layers
Browse files Browse the repository at this point in the history
  • Loading branch information
docktermj committed Aug 26, 2024
1 parent 26f9c47 commit 1b1f55a
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions package.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# -----------------------------------------------------------------------------

ARG IMAGE_SENZINGAPI_RUNTIME=senzing/senzingapi-runtime-staging:latest
ARG IMAGE_GO_BUILDER=golang:1.22.3-bullseye
ARG IMAGE_FPM_BUILDER=dockter/fpm:latest
ARG IMAGE_BUILDER=golang:1.22.3-bullseye
ARG IMAGE_FPM=dockter/fpm:latest
ARG IMAGE_FINAL=alpine

# -----------------------------------------------------------------------------
Expand All @@ -14,10 +14,10 @@ ARG IMAGE_FINAL=alpine
FROM ${IMAGE_SENZINGAPI_RUNTIME} AS senzingapi_runtime

# -----------------------------------------------------------------------------
# Stage: go_builder
# Stage: builder
# -----------------------------------------------------------------------------

FROM ${IMAGE_GO_BUILDER} AS go_builder
FROM ${IMAGE_BUILDER} AS builder
ENV REFRESHED_AT=2024-07-01
LABEL Name="senzing/go-builder" \
Maintainer="support@senzing.com" \
Expand Down Expand Up @@ -51,12 +51,12 @@ RUN mkdir -p /output \
&& cp -R ${GOPATH}/src/${GO_PACKAGE_NAME}/target/* /output/

# -----------------------------------------------------------------------------
# Stage: fpm_builder
# Stage: fpm
# - Reference: https://github.com/jordansissel/fpm/blob/master/Dockerfile
# - FPM: https://fpm.readthedocs.io/en/latest/cli-reference.html
# -----------------------------------------------------------------------------

FROM ${IMAGE_FPM_BUILDER} AS fpm_builder
FROM ${IMAGE_FPM} AS fpm
ENV REFRESHED_AT=2024-07-01
LABEL Name="senzing/fpm-builder" \
Maintainer="support@senzing.com" \
Expand All @@ -71,7 +71,7 @@ ARG GO_PACKAGE_NAME

# Copy files from prior stage.

COPY --from=go_builder "/output/linux-amd64/*" "/output/linux-amd64/"
COPY --from=builder "/output/linux-amd64/*" "/output/linux-amd64/"

# Create Linux RPM package.

Expand Down Expand Up @@ -117,8 +117,8 @@ ARG PROGRAM_NAME

# Copy files from prior step.

COPY --from=fpm_builder "/output/*" "/output/"
COPY --from=fpm_builder "/output/linux-amd64/${PROGRAM_NAME}" "/output/linux-amd64/${PROGRAM_NAME}"
COPY --from=fpm "/output/*" "/output/"
COPY --from=fpm "/output/linux-amd64/${PROGRAM_NAME}" "/output/linux-amd64/${PROGRAM_NAME}"

USER 1001
CMD ["/bin/bash"]

0 comments on commit 1b1f55a

Please sign in to comment.