summaryrefslogtreecommitdiffstats
path: root/Dockerfile
diff options
context:
space:
mode:
authorAdrian <colid.bondzio@gmail.com>2022-03-26 22:54:32 +0100
committerJesse Duffield <jessedduffield@gmail.com>2022-03-27 22:03:16 +1100
commitac406f57fff58b20e6dd73a917db842085a96c35 (patch)
tree47b4f49c59fe60afb097483f275715bfd69db52d /Dockerfile
parent5a0ac6fe67c03a919b1948046839347cfc6bbb4f (diff)
[fix] Fixed Dockerfile
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile14
1 files changed, 8 insertions, 6 deletions
diff --git a/Dockerfile b/Dockerfile
index aec4ff2a0..4271aca48 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -2,16 +2,18 @@
# docker build -t lazygit .
# docker run -it lazygit:latest /bin/sh
-FROM golang:1.14-alpine3.11
+FROM golang:1.18 as build
WORKDIR /go/src/github.com/jesseduffield/lazygit/
-COPY ./ .
+COPY go.mod go.sum ./
+RUN go mod download
+COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build
-FROM alpine:3.11
-RUN apk add -U git xdg-utils
+FROM alpine:3.15
+RUN apk add --no-cache -U git xdg-utils
WORKDIR /go/src/github.com/jesseduffield/lazygit/
-COPY --from=0 /go/src/github.com/jesseduffield/lazygit /go/src/github.com/jesseduffield/lazygit
-COPY --from=0 /go/src/github.com/jesseduffield/lazygit/lazygit /bin/
+COPY --from=build /go/src/github.com/jesseduffield/lazygit ./
+COPY --from=build /go/src/github.com/jesseduffield/lazygit/lazygit /bin/
RUN echo "alias gg=lazygit" >> ~/.profile
ENTRYPOINT [ "lazygit" ]