-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.linux
More file actions
34 lines (25 loc) · 802 Bytes
/
Dockerfile.linux
File metadata and controls
34 lines (25 loc) · 802 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
26
27
28
29
30
31
32
33
34
#############################
# Linux Dockerfile
#############################
FROM golang:1.23 AS builder-linux
# Set environment variables for Linux
ENV GOARCH=amd64
ENV GOOS=linux
WORKDIR /app
# Copy Go module files first (cache optimization)
COPY go.mod go.sum ./
RUN go mod download
# Copy the Go source code
COPY . .
# Build the Linux binary
RUN go build -o 3270Connect-linux go3270Connect.go
#############################
# Final stage for Linux
#############################
FROM alpine:latest AS final-linux
# Copy the Linux binary from the builder
COPY --from=builder-linux /app/3270Connect-linux /usr/local/bin/3270Connect
# Make the binary executable
RUN chmod +x /usr/local/bin/3270Connect
# Define the entrypoint for the Linux container
ENTRYPOINT ["/usr/local/bin/3270Connect"]