-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support multi-stage builds for Management & Treatment Services Dockerfile #66
Merged
terryyylim
merged 20 commits into
caraml-dev:main
from
terryyylim:update-docker-image-perms
Mar 14, 2023
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
40190ad
Update management dockerfile
terryyylim 93501fe
Make binary executable
terryyylim d4bcd3c
Add debugging lines
terryyylim d3b1cf8
Combine chmod
terryyylim 5ed7faa
Revert last change
terryyylim 798bbaf
Update Treatment Service Dockerfile
terryyylim 8ffcfbd
Remove additional updates
terryyylim b093657
Update Dockerfile deps
terryyylim b44bf53
Update ln
terryyylim ece9a9b
Use debian
terryyylim 7ba76d5
Just use ubuntu
terryyylim fe4bf47
Add multi-stage build
terryyylim c9f045f
Update workflow versions
terryyylim 6752273
Update CMD...
terryyylim 0f327a4
Update Treatment Service Dockerfile and deps
terryyylim f49a433
Make Management Service Dockerfile multi-step build
terryyylim 2b6c32a
Remove binary download step in release workflow
terryyylim da86605
Copy API specs
terryyylim 2b80ed7
Standardize schema file copy
terryyylim 59f7ab4
Address PR comments
terryyylim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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,11 +1,31 @@ | ||
FROM alpine:latest | ||
FROM golang:1.18-alpine as api-builder | ||
ARG API_BIN_NAME=xp-treatment | ||
|
||
RUN apk update && apk add musl-dev gcc | ||
|
||
ENV GO111MODULE=on \ | ||
GOOS=linux \ | ||
GOARCH=amd64 | ||
|
||
WORKDIR /app | ||
COPY . . | ||
|
||
RUN apk update && apk add git make bash unzip libtool gcc musl-dev ca-certificates dumb-init tzdata | ||
# Build Treatment Service binary | ||
RUN go build \ | ||
-mod=vendor \ | ||
-tags musl \ | ||
-o ./bin/${API_BIN_NAME} | ||
|
||
FROM alpine:latest | ||
|
||
RUN apk update && apk add git make bash unzip libtool ca-certificates dumb-init tzdata | ||
RUN mkdir -p /opt/xp_treatment | ||
|
||
COPY . /opt/xp_treatment/ | ||
COPY ./bin/* /opt/xp_treatment/ | ||
COPY --from=api-builder /app/bin/* /opt/xp_treatment/ | ||
|
||
WORKDIR /opt/xp_treatment | ||
ENTRYPOINT [ "./xp-treatment" ] | ||
|
||
ARG API_BIN_NAME=xp-treatment | ||
ENV XP_API_BIN "./${API_BIN_NAME}" | ||
|
||
ENTRYPOINT ["sh", "-c", "${XP_API_BIN} \"$@\"", "--"] |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probabl also add commands to vendor the
common
andclients
modules before vendoring the management service.