Skip to content

Commit 558a1db

Browse files
authored
fix: add ca-certificates (#22)
1 parent 7eb317f commit 558a1db

File tree

12 files changed

+24
-11
lines changed

12 files changed

+24
-11
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ related to this tool.
1616
- [x] Support for a wide range of the most popular languages and frameworks including Next.js, Phoenix, Spring Boot, Django, and more
1717
- [x] Use Debian Slim as the runtime image for a smaller image size and better security, while still supporting the most common dependencies and avoiding deployment headaches caused by Alpine Linux gotchas
1818
- [x] Includes `wget` in the runtime image for adding health checks to services, e.g. `wget -nv -t1 --spider 'http://localhost:8080/healthz' || exit 1`
19+
- [x] Includes `ca-certificates` in the runtime image to allow secure HTTPS connections
1920
- [x] Use multi-stage builds to reduce the size of the final image
2021
- [x] Run the application as a non-root user for better security
2122
- [x] Supports multi-platform images that run on both x86 and ARM CPU architectures

runtime/bun.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ RUN if [ ! -z "${BUILD_CMD}" ]; then sh -c "$BUILD_CMD"; fi
157157
FROM oven/bun:${VERSION}-slim AS runtime
158158
WORKDIR /app
159159
160-
RUN apt-get update && apt-get install -y --no-install-recommends wget && apt-get clean && rm -f /var/lib/apt/lists/*_*
160+
RUN apt-get update && apt-get install -y --no-install-recommends wget ca-certificates && apt-get clean && rm -f /var/lib/apt/lists/*_*
161+
RUN update-ca-certificates 2>/dev/null || true
161162
RUN addgroup --system nonroot && adduser --system --ingroup nonroot nonroot
162163
RUN chown -R nonroot:nonroot /app
163164

runtime/deno.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@ FROM denoland/deno:${VERSION} as base
174174
FROM debian:stable-slim
175175
WORKDIR /app
176176
177-
RUN apt-get update && apt-get install -y --no-install-recommends wget && apt-get clean && rm -f /var/lib/apt/lists/*_*
177+
RUN apt-get update && apt-get install -y --no-install-recommends wget ca-certificates && apt-get clean && rm -f /var/lib/apt/lists/*_*
178+
RUN update-ca-certificates 2>/dev/null || true
178179
RUN addgroup --system nonroot && adduser --system --ingroup nonroot nonroot
179180
RUN chown -R nonroot:nonroot /app
180181

runtime/elixir.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ RUN mix release
109109
FROM debian:stable-slim AS runtime
110110
WORKDIR /app
111111
RUN apt-get update && apt-get install -y --no-install-recommends wget libstdc++6 openssl libncurses5 locales ca-certificates && apt-get clean && rm -f /var/lib/apt/lists/*_*
112+
RUN update-ca-certificates 2>/dev/null || true
112113
RUN addgroup --system nonroot && adduser --system --ingroup nonroot nonroot
113114
114115
RUN chown -R nonroot:nonroot /app

runtime/golang.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ RUN CGO_ENABLED=${CGO_ENABLED} GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -t
122122
123123
FROM debian:stable-slim
124124
WORKDIR /app
125-
RUN apt-get update && apt-get install -y --no-install-recommends wget && apt-get clean && rm -f /var/lib/apt/lists/*_*
125+
RUN apt-get update && apt-get install -y --no-install-recommends wget ca-certificates && apt-get clean && rm -f /var/lib/apt/lists/*_*
126+
RUN update-ca-certificates 2>/dev/null || true
126127
RUN addgroup --system nonroot && adduser --system --ingroup nonroot nonroot
127128
RUN chown -R nonroot:nonroot /app
128129

runtime/java.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ FROM eclipse-temurin:${VERSION}-jdk AS runtime
157157
WORKDIR /app
158158
VOLUME /tmp
159159
160-
RUN apt-get update && apt-get install -y --no-install-recommends wget && apt-get clean && rm -f /var/lib/apt/lists/*_*
160+
RUN apt-get update && apt-get install -y --no-install-recommends wget ca-certificates && apt-get clean && rm -f /var/lib/apt/lists/*_*
161+
RUN update-ca-certificates 2>/dev/null || true
161162
RUN addgroup --system nonroot && adduser --system --ingroup nonroot nonroot
162163
RUN chown -R nonroot:nonroot /app
163164

runtime/nextjs.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ ENV NODE_ENV=production
144144
# Uncomment the following line in case you want to disable telemetry during runtime.
145145
ENV NEXT_TELEMETRY_DISABLED 1
146146
147-
RUN apt-get update && apt-get install -y --no-install-recommends wget && apt-get clean && rm -f /var/lib/apt/lists/*_*
147+
RUN apt-get update && apt-get install -y --no-install-recommends wget ca-certificates && apt-get clean && rm -f /var/lib/apt/lists/*_*
148+
RUN update-ca-certificates 2>/dev/null || true
148149
RUN addgroup --system nonroot && adduser --system --ingroup nonroot nonroot
149150
RUN chown -R nonroot:nonroot /app
150151
@@ -201,7 +202,8 @@ RUN if [ -f yarn.lock ]; then yarn run build; \
201202
FROM base AS runner
202203
WORKDIR /app
203204
204-
RUN apt-get update && apt-get install -y --no-install-recommends wget && apt-get clean && rm -f /var/lib/apt/lists/*_*
205+
RUN apt-get update && apt-get install -y --no-install-recommends wget ca-certificates && apt-get clean && rm -f /var/lib/apt/lists/*_*
206+
RUN update-ca-certificates 2>/dev/null || true
205207
RUN addgroup --system nonroot && adduser --system --ingroup nonroot nonroot
206208
RUN chown -R nonroot:nonroot /app
207209

runtime/node.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@ RUN if [ ! -z "${BUILD_CMD}" ]; then sh -c "$BUILD_CMD"; fi
188188
FROM base AS runtime
189189
WORKDIR /app
190190
191-
RUN apt-get update && apt-get install -y --no-install-recommends wget && apt-get clean && rm -f /var/lib/apt/lists/*_*
191+
RUN apt-get update && apt-get install -y --no-install-recommends wget ca-certificates && apt-get clean && rm -f /var/lib/apt/lists/*_*
192+
RUN update-ca-certificates 2>/dev/null || true
192193
RUN addgroup --system nonroot && adduser --disabled-login --ingroup nonroot nonroot
193194
ENV COREPACK_HOME=/app/.cache
194195
RUN mkdir -p /app/.cache

runtime/php.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ RUN if [ ! -z "${BUILD_CMD}" ]; then sh -c "$BUILD_CMD"; fi
154154
155155
FROM php:${VERSION}-apache AS runtime
156156
157-
RUN apt-get update && apt-get install -y --no-install-recommends wget && apt-get clean && rm -f /var/lib/apt/lists/*_*
157+
RUN apt-get update && apt-get install -y --no-install-recommends wget ca-certificates && apt-get clean && rm -f /var/lib/apt/lists/*_*
158+
RUN update-ca-certificates 2>/dev/null || true
158159
RUN addgroup --system nonroot && adduser --system --ingroup nonroot nonroot
159160
160161
ENV PORT=8080

runtime/python.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ var pythonTemplate = strings.TrimSpace(`
161161
ARG VERSION={{.Version}}
162162
FROM python:${VERSION}-slim
163163
WORKDIR /app
164-
RUN apt-get update && apt-get install -y --no-install-recommends wget && apt-get clean && rm -f /var/lib/apt/lists/*_*
164+
RUN apt-get update && apt-get install -y --no-install-recommends wget ca-certificates && apt-get clean && rm -f /var/lib/apt/lists/*_*
165+
RUN update-ca-certificates 2>/dev/null || true
165166
RUN addgroup --system nonroot && adduser --system --ingroup nonroot nonroot
166167
RUN chown -R nonroot:nonroot /app
167168

runtime/ruby.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ var rubyTemplate = strings.TrimSpace(`
133133
ARG VERSION={{.Version}}
134134
FROM ruby:${VERSION}-slim
135135
WORKDIR /app
136-
RUN apt-get update && apt-get install -y --no-install-recommends wget && apt-get clean && rm -f /var/lib/apt/lists/*_*
136+
RUN apt-get update && apt-get install -y --no-install-recommends wget ca-certificates && apt-get clean && rm -f /var/lib/apt/lists/*_*
137+
RUN update-ca-certificates 2>/dev/null || true
137138
RUN addgroup --system nonroot && adduser --system --ingroup nonroot nonroot
138139
139140
ARG INSTALL_CMD={{.InstallCMD}}

runtime/rust.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ RUN if [ "${TARGETARCH}" = "amd64" ]; then cargo zigbuild --release --target x86
110110
FROM debian:stable-slim AS runtime
111111
WORKDIR /app
112112
113-
RUN apt-get update && apt-get install -y --no-install-recommends wget && apt-get clean && rm -f /var/lib/apt/lists/*_*
113+
RUN apt-get update && apt-get install -y --no-install-recommends wget ca-certificates && apt-get clean && rm -f /var/lib/apt/lists/*_*
114+
RUN update-ca-certificates 2>/dev/null || true
114115
RUN addgroup --system nonroot && adduser --system --ingroup nonroot nonroot
115116
RUN chown -R nonroot:nonroot /app
116117

0 commit comments

Comments
 (0)