Skip to content

Commit 30e09cc

Browse files
authored
Merge pull request #207 from DefangLabs/jordan/no-golang-slim-image
Fix golang samples: there are no golang-slim images
2 parents cb219c5 + 6794b1e commit 30e09cc

File tree

8 files changed

+15
-29
lines changed

8 files changed

+15
-29
lines changed

samples/golang-http-form/app/Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Use an official Go runtime as a parent image
2-
FROM golang:1.20-slim as builder
2+
FROM golang:1.20 as builder
33

44
# Set the working directory in the builder container
55
WORKDIR /src
@@ -17,9 +17,7 @@ COPY . .
1717
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main .
1818

1919
# Start a new stage from scratch
20-
FROM golang:1.20-slim
21-
22-
RUN apt update && apt install -y curl ca-certificates
20+
FROM golang:1.20
2321

2422
WORKDIR /root/
2523

samples/golang-http/app/Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Use an official Go runtime as a parent image
2-
FROM golang:1.20-alpine as builder
2+
FROM golang:1.20 as builder
33

44
# Set the working directory in the builder container
55
WORKDIR /src
@@ -17,9 +17,7 @@ COPY . .
1717
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main .
1818

1919
# Start a new stage from scratch
20-
FROM alpine:latest
21-
22-
RUN apk --no-cache add ca-certificates
20+
FROM golang:1.20
2321

2422
WORKDIR /root/
2523

samples/golang-http/compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ services:
1212
reservations:
1313
memory: 50M
1414
healthcheck:
15-
test: ["CMD", "wget", "-q", "--spider", "http://localhost:8080/"]
15+
test: ["CMD", "curl", "-f", "http://localhost:8080/"]

samples/golang-mongodb-atlas/app/Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Start from the official Go image.
2-
FROM golang:1.20-slim as builder
2+
FROM golang:1.20 as builder
33

44
# Set the Current Working Directory inside the container
55
WORKDIR /app
@@ -17,9 +17,7 @@ COPY . .
1717
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o taskmanager .
1818

1919
# Start a new stage from scratch
20-
FROM golang:1.20-slim
21-
22-
RUN apt update && apt install -y curl ca-certificates
20+
FROM golang:1.20
2321

2422
WORKDIR /root/
2523

samples/golang-openai/app/Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Use an official Go runtime as a parent image
2-
FROM golang:1.20-slim as builder
2+
FROM golang:1.20 as builder
33

44
# Set the working directory in the builder container
55
WORKDIR /src
@@ -17,9 +17,7 @@ COPY . .
1717
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main .
1818

1919
# Start a new stage from scratch
20-
FROM golang:1.20-slim
21-
22-
RUN apt update && apt install -y curl ca-certificates
20+
FROM golang:1.20
2321

2422
WORKDIR /root/
2523

samples/golang-rest-api/app/Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Use an official Go runtime as a parent image
2-
FROM golang:1.20-slim as builder
2+
FROM golang:1.20 as builder
33

44
# Set the working directory in the builder container
55
WORKDIR /src
@@ -17,9 +17,7 @@ COPY . .
1717
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main .
1818

1919
# Start a new stage from scratch
20-
FROM golang:1.20-slim
21-
22-
RUN apt update && apt install -y curl ca-certificates
20+
FROM golang:1.20
2321

2422
WORKDIR /root/
2523

samples/golang-s3/app/Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Use an official Go runtime as a parent image
2-
FROM golang:1.20-slim as builder
2+
FROM golang:1.20 as builder
33

44
# Set the working directory in the builder container
55
WORKDIR /src
@@ -17,9 +17,7 @@ COPY . .
1717
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main .
1818

1919
# Start a new stage from scratch
20-
FROM golang:1.20-slim
21-
22-
RUN apt update && apt install -y curl ca-certificates
20+
FROM golang:1.20
2321

2422
WORKDIR /root/
2523

samples/golang-slackbot/app/Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Use an official Go runtime as a parent image
2-
FROM golang:1.20-slim as builder
2+
FROM golang:1.20 as builder
33

44
# Set the working directory in the builder container
55
WORKDIR /src
@@ -17,9 +17,7 @@ COPY . .
1717
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main .
1818

1919
# Start a new stage from scratch
20-
FROM golang:1.20-slim
21-
22-
RUN apt update && apt install -y curl ca-certificates
20+
FROM golang:1.20
2321

2422
WORKDIR /root/
2523

0 commit comments

Comments
 (0)