Skip to content

Commit ad39924

Browse files
authored
Merge pull request #429 from snyk/feat/build-ubi-image
feat: build snyk-monitor with a Red Hat UBI 8 base image
2 parents 56d9480 + f57c2bd commit ad39924

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

Dockerfile

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,20 @@ RUN cd $GOPATH/src/github.com/containers/skopeo \
1212
#---------------------------------------------------------------------
1313
# STAGE 2: Build the kubernetes-monitor
1414
#---------------------------------------------------------------------
15-
FROM node:erbium-alpine
15+
FROM registry.access.redhat.com/ubi8/ubi:latest
1616

1717
LABEL maintainer="Snyk Ltd"
1818

1919
ENV NODE_ENV production
2020

21-
RUN apk update
22-
RUN apk upgrade
23-
RUN apk --no-cache add dumb-init
21+
RUN curl -sL https://rpm.nodesource.com/setup_12.x | bash -
22+
RUN yum install -y nodejs
2423

25-
RUN addgroup -S -g 10001 snyk
26-
RUN adduser -S -G snyk -h /srv/app -u 10001 snyk
24+
RUN curl -L -o /usr/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_amd64
25+
RUN chmod 755 /usr/bin/dumb-init
26+
27+
RUN groupadd -g 10001 snyk
28+
RUN useradd -g snyk -d /srv/app -u 10001 snyk
2729

2830
WORKDIR /srv/app
2931
USER 10001:10001
@@ -45,6 +47,9 @@ RUN npm install
4547
# add the rest of the app files
4648
ADD --chown=snyk:snyk . .
4749

50+
# OpenShift 4 doesn't allow dumb-init access the app folder without this permission.
51+
RUN chmod 755 /srv/app && chmod 755 /srv/app/bin && chmod +x /srv/app/bin/start
52+
4853
# Complete any `prepare` tasks (e.g. typescript), as this step ran automatically prior to app being copied
4954
RUN npm run prepare
5055

0 commit comments

Comments
 (0)