Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add caching to Linux docker run #123

Merged
merged 2 commits into from
Oct 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,22 @@
# -----------
FROM golang:1.23-alpine3.19 AS build

WORKDIR /app

# Go build env
ENV CGO_ENABLED=0

WORKDIR /app

# Install source deps
COPY go.mod go.sum ./
RUN go mod download
RUN --mount=type=cache,target=/go/pkg/mod \
go mod download

# Copy source & build
COPY . .
RUN go build -v -ldflags '-s' -o /bin/ryuk
RUN chmod +x /bin/ryuk
COPY --link . .

RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
go build -ldflags '-s' -o /bin/ryuk

# -----------------
# Distributed Image
Expand Down
Loading