diff options
author | 2023-01-23 10:43:39 -0800 | |
---|---|---|
committer | 2023-01-23 10:43:39 -0800 | |
commit | 6b99960380132dc92837e7a67e95901e144e38b0 (patch) | |
tree | c8c7dddffe24768c697c8fd4557afad554800131 /Dockerfile | |
parent | f417482fee7df5b2f6cd1ae3e235e391aba56364 (diff) | |
download | sally-6b99960380132dc92837e7a67e95901e144e38b0.tar.gz sally-6b99960380132dc92837e7a67e95901e144e38b0.tar.zst sally-6b99960380132dc92837e7a67e95901e144e38b0.zip |
Add minimal Dockerfile (#72)
Adds a Dockerfile that builds sally using a phased Docker build.
The first phase builds sally,
and the second phase publishes a scratch image
with just sally.
If Uber publishes this to a container registry,
a user can use it like so:
% vim sally.yaml # create a sally yaml
% cat > Dockerfile
FROM sally:latest
COPY sally.yaml /sally.yaml
% docker build .
Even without publishing, this provides an example
of how to build sally for deployment.
Testing:
I verified the instructions above locally
by tagging locally with:
% docker build -t sally:latest
I'm also using a variation of this Dockerfile in production
right now for my own hosted instance of sally.
Diffstat (limited to 'Dockerfile')
-rw-r--r-- | Dockerfile | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d6033ac --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +# This image provides the sally binary. +# It does not include a sally configuration. +# A /sally.yaml file is required for this to run. + +FROM golang:1.19-alpine + +COPY . /build +WORKDIR /build +RUN CGO_ENABLED=0 go build -ldflags="-w -s" -o sally go.uber.org/sally + +FROM scratch +COPY --from=0 /build/sally /sally +EXPOSE 8080 +WORKDIR / +CMD ["/sally"] |