forked from sourcenetwork/defradb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Runner and Builder Containerfiles (sourcenetwork#951)
- Loading branch information
1 parent
2dcb3db
commit 9b0c5ed
Showing
3 changed files
with
36 additions
and
23 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
# An image with defradb's code and go tooling available, to assemble in a larger container. | ||
|
||
FROM docker.io/golang:1.18 AS BUILD | ||
|
||
WORKDIR /lib/defradb/ | ||
|
||
COPY . . | ||
RUN make deps:modules |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
# An image to run defradb. | ||
|
||
# Stage: BUILD | ||
# Several steps are involved to enable caching and because of the behavior of COPY regarding directories. | ||
FROM docker.io/golang:1.18 AS BUILD | ||
WORKDIR /repo/ | ||
COPY go.mod go.sum Makefile ./ | ||
RUN make deps:modules | ||
COPY . . | ||
RUN make build | ||
|
||
# Stage: RUN | ||
FROM gcr.io/distroless/base-debian11 | ||
COPY --from=BUILD /repo/build/defradb /defradb | ||
|
||
# Documents which ports are normally used. | ||
# To publish the ports: `docker run -p 9181:9181` ... | ||
EXPOSE 9161 | ||
EXPOSE 9171 | ||
EXPOSE 9181 | ||
|
||
# Default command provided for convenience. | ||
# e.g. docker run -p 9181:9181 source/defradb start --url 0.0.0.0:9181 | ||
ENTRYPOINT [ "/defradb" ] |