diff --git a/Dockerfile b/Dockerfile index c448185b..192acfc0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ -FROM ubuntu:20.04 AS build +FROM ubuntu:22.04 AS build RUN apt-get update && \ apt-get -y upgrade && \ - apt-get install -y wget + apt-get install -y --no-install-recommends wget ca-certificates ENV GO_INSTALLER=go1.19.5.linux-amd64.tar.gz WORKDIR /tmp RUN wget https://dl.google.com/go/$GO_INSTALLER && \ @@ -12,7 +12,7 @@ ENV GOROOT=/usr/local/go ENV PATH=$GOROOT/bin:$PATH ENV GOPROXY="https://proxy.golang.org" RUN apt-get update && \ - apt-get install -y git && \ + apt-get install -y --no-install-recommends git && \ apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ENV CGO_ENABLED 0 COPY ./ ./ @@ -22,19 +22,18 @@ ARG TEST="true" RUN if [ "$TEST" != "false" ]; then ./validate.sh ; fi 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`" . -FROM ubuntu:20.04 AS release +FROM ubuntu:22.04 AS release LABEL maintainer="hans.hjort@xandr.com" RUN apt-get update && \ - apt-get install --assume-yes apt-utils && \ - apt-get install -y ca-certificates && \ + apt-get install -y --no-install-recommends ca-certificates && \ apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* WORKDIR /usr/local/bin/ COPY --from=build /app/prebid-cache/prebid-cache . RUN chmod a+xr prebid-cache COPY --from=build /app/prebid-cache/config.yaml . RUN chmod a+r config.yaml -RUN adduser prebid_user -USER prebid_user +RUN addgroup --system --gid 2001 prebidgroup && adduser --system --uid 1001 --ingroup prebidgroup prebid +USER prebid EXPOSE 2424 EXPOSE 2525 ENTRYPOINT ["/usr/local/bin/prebid-cache"]