-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #329 from Lumerin-protocol/dev
TEST-1.0.60 Update for versioning
- Loading branch information
Showing
3 changed files
with
33 additions
and
9 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
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 |
---|---|---|
@@ -1,23 +1,38 @@ | ||
# Stage 1: Build | ||
FROM golang:1.22.3-alpine as builder | ||
|
||
# Capture the Git tag and commit hash during build | ||
ARG TAG_NAME | ||
ARG COMMIT | ||
ENV TAG_NAME=$TAG_NAME | ||
ENV COMMIT=$COMMIT | ||
|
||
WORKDIR /app | ||
WORKDIR /app | ||
COPY . . | ||
|
||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 ./build.sh&& \ | ||
cp /bin/sh /app/sh && chmod +x /app/sh | ||
# Build the Go binary (recommended for linux/amd64...for MacARM use buildx) | ||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \ | ||
TAG_NAME=$TAG_NAME COMMIT=$COMMIT ./build.sh && \ | ||
cp /bin/sh /app/sh && chmod +x /app/sh | ||
|
||
# Multiplatform Build Notes: | ||
# to support both amd64 and arm64, use Docker’s Buildx to create a multi-architecture image | ||
# docker buildx create --use | ||
# docker buildx build --platform linux/amd64,linux/arm64 -t proxy-router:latest . | ||
|
||
# Stage 2: Final Image | ||
FROM scratch | ||
WORKDIR /app | ||
|
||
# Copy required files and binary | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
COPY --from=builder /app/bin/proxy-router /usr/bin/ | ||
# COPY --from=builder /usr/bin/dbus-launch /usr/bin/ | ||
# COPY --from=builder /app/.env /app/.env | ||
|
||
# Optional Copy utilities from busybox image | ||
# COPY --from=busybox /bin /bin | ||
# COPY --from=busybox /lib /lib | ||
|
||
SHELL ["/bin/sh", "-c"] | ||
EXPOSE 3333 8082 | ||
|
||
ENTRYPOINT ["proxy-router"] |
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