Skip to content

Commit

Permalink
ci: Runner and Builder Containerfiles (sourcenetwork#951)
Browse files Browse the repository at this point in the history
  • Loading branch information
orpheuslummis authored Jan 27, 2023
1 parent 2dcb3db commit 9b0c5ed
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 23 deletions.
23 changes: 0 additions & 23 deletions Dockerfile

This file was deleted.

10 changes: 10 additions & 0 deletions tools/defradb-builder.containerfile
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
26 changes: 26 additions & 0 deletions tools/defradb.containerfile
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" ]

0 comments on commit 9b0c5ed

Please sign in to comment.