-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
25 lines (18 loc) · 756 Bytes
/
Copy pathDockerfile
File metadata and controls
25 lines (18 loc) · 756 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Use the latest Alpine as the base image
FROM alpine:latest
# Install necessary dependencies for building Go applications
RUN apk add --no-cache ca-certificates git
# Set the latest Go version as an environment variable
ENV GO_VERSION=1.21.0
# Download and install the latest Go binary
RUN wget -q https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz && \
tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz && \
rm go${GO_VERSION}.linux-amd64.tar.gz
# Add Go binaries to the system path
ENV PATH="/usr/local/go/bin:${PATH}"
# Set the working directory
WORKDIR /go/src/github.com/lindsaygelle/gomap
# Copy the application source code into the container
COPY . .
# Download and cache the Go module dependencies
RUN go mod download