Skip to content

Commit fa67a3e

Browse files
Vulnerabilities fixes & Upgrade to Ubuntu 22.04 (#190)
1 parent 75dfa4e commit fa67a3e

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

Dockerfile

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
FROM ubuntu:20.04 AS build
1+
FROM ubuntu:22.04 AS build
22
RUN apt-get update && \
33
apt-get -y upgrade && \
4-
apt-get install -y wget
4+
apt-get install -y --no-install-recommends wget ca-certificates
55
ENV GO_INSTALLER=go1.19.5.linux-amd64.tar.gz
66
WORKDIR /tmp
77
RUN wget https://dl.google.com/go/$GO_INSTALLER && \
@@ -12,7 +12,7 @@ ENV GOROOT=/usr/local/go
1212
ENV PATH=$GOROOT/bin:$PATH
1313
ENV GOPROXY="https://proxy.golang.org"
1414
RUN apt-get update && \
15-
apt-get install -y git && \
15+
apt-get install -y --no-install-recommends git && \
1616
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
1717
ENV CGO_ENABLED 0
1818
COPY ./ ./
@@ -22,19 +22,18 @@ ARG TEST="true"
2222
RUN if [ "$TEST" != "false" ]; then ./validate.sh ; fi
2323
RUN go build -mod=vendor -ldflags "-X github.com/prebid/prebid-cache/version.Ver=`git describe --tags` -X github.com/prebid/prebid-cache/version.Rev=`git rev-parse HEAD`" .
2424

25-
FROM ubuntu:20.04 AS release
25+
FROM ubuntu:22.04 AS release
2626
LABEL maintainer="hans.hjort@xandr.com"
2727
RUN apt-get update && \
28-
apt-get install --assume-yes apt-utils && \
29-
apt-get install -y ca-certificates && \
28+
apt-get install -y --no-install-recommends ca-certificates && \
3029
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
3130
WORKDIR /usr/local/bin/
3231
COPY --from=build /app/prebid-cache/prebid-cache .
3332
RUN chmod a+xr prebid-cache
3433
COPY --from=build /app/prebid-cache/config.yaml .
3534
RUN chmod a+r config.yaml
36-
RUN adduser prebid_user
37-
USER prebid_user
35+
RUN addgroup --system --gid 2001 prebidgroup && adduser --system --uid 1001 --ingroup prebidgroup prebid
36+
USER prebid
3837
EXPOSE 2424
3938
EXPOSE 2525
4039
ENTRYPOINT ["/usr/local/bin/prebid-cache"]

0 commit comments

Comments
 (0)