Skip to content

Commit ece7dd4

Browse files
authored
Use Distroless runtime images (#316)
Distroless images present a smaller attack surface as they ship without a package manager, shell and the like. These have been promoted out of experimental status since I last checked. https://github.com/GoogleContainerTools/distroless/tree/master/nodejs
1 parent 30bc4e7 commit ece7dd4

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

.changeset/wise-fans-join.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'skuba': patch
3+
---
4+
5+
**template/\*-rest-api:** Use Distroless runtime images

template/express-rest-api/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ RUN yarn build
5050

5151
###
5252

53-
FROM node:12-alpine AS runtime
53+
FROM gcr.io/distroless/nodejs:12 AS runtime
5454

5555
WORKDIR /workdir
5656

@@ -64,4 +64,4 @@ ARG PORT=8001
6464
ENV PORT ${PORT}
6565
EXPOSE ${PORT}
6666

67-
CMD node lib/listen
67+
CMD ["lib/listen.js"]

template/koa-rest-api/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ RUN yarn build
5050

5151
###
5252

53-
FROM node:12-alpine AS runtime
53+
FROM gcr.io/distroless/nodejs:12 AS runtime
5454

5555
WORKDIR /workdir
5656

@@ -64,4 +64,4 @@ ARG PORT=8001
6464
ENV PORT ${PORT}
6565
EXPOSE ${PORT}
6666

67-
CMD node lib/listen
67+
CMD ["lib/listen.js"]

0 commit comments

Comments
 (0)