From 519f71af58fd1da678f0f2548630923f7e386e06 Mon Sep 17 00:00:00 2001 From: aaron0x Date: Tue, 1 Apr 2025 15:29:28 +0800 Subject: [PATCH 1/3] Use vendor folder with go build in Dockerfile --- Dockerfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 796787a6d1f..26c0c3939c8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,10 +4,8 @@ FROM golang:1.24 as build WORKDIR /go/src/github.com/jesseduffield/lazygit/ -COPY go.mod go.sum ./ -RUN go mod download COPY . . -RUN CGO_ENABLED=0 GOOS=linux go build +RUN CGO_ENABLED=0 GOOS=linux go build -mod=vendor FROM alpine:3.19 RUN apk add --no-cache -U git xdg-utils From fbf72cde1f84efaa80744a54d2eb0bebb432b655 Mon Sep 17 00:00:00 2001 From: aaron0x Date: Tue, 1 Apr 2025 15:32:10 +0800 Subject: [PATCH 2/3] Fix "casing do not match" warning during docker build --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 26c0c3939c8..fd97208af48 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ # docker build -t lazygit . # docker run -it lazygit:latest /bin/sh -FROM golang:1.24 as build +FROM golang:1.24 AS build WORKDIR /go/src/github.com/jesseduffield/lazygit/ COPY . . RUN CGO_ENABLED=0 GOOS=linux go build -mod=vendor From 9fde0bcdf44033a138d4fad9ba26f11a382cb76b Mon Sep 17 00:00:00 2001 From: aaron0x Date: Tue, 1 Apr 2025 15:35:50 +0800 Subject: [PATCH 3/3] Fix run example in Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index fd97208af48..ed3cf090f9d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # run with: # docker build -t lazygit . -# docker run -it lazygit:latest /bin/sh +# docker run -it lazygit:latest FROM golang:1.24 AS build WORKDIR /go/src/github.com/jesseduffield/lazygit/