forked from renovatebot/docker-renovate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
67 lines (49 loc) · 1.75 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# renovate: datasource=npm depName=renovate versioning=npm
ARG RENOVATE_VERSION=32.78.1
# Base image
#============
FROM renovate/buildpack:6@sha256:14f0386d5a576d5bdca4f53dfa2553b99485de882ca7213484f50b54e3e2d7de AS base
LABEL name="renovate"
LABEL org.opencontainers.image.source="https://github.com/renovatebot/renovate" \
org.opencontainers.image.url="https://renovatebot.com" \
org.opencontainers.image.licenses="AGPL-3.0-only"
# renovate: datasource=node
RUN install-tool node v16.15.1
# renovate: datasource=npm versioning=npm
RUN install-tool yarn 1.22.18
WORKDIR /usr/src/app
# Build image
#============
FROM base as tsbuild
COPY . .
RUN set -ex; \
yarn install; \
yarn build; \
chmod +x dist/*.js;
ARG RENOVATE_VERSION
RUN set -ex; \
yarn version --new-version ${RENOVATE_VERSION}; \
yarn add -E renovate@${RENOVATE_VERSION} --production; \
node -e "new require('re2')('.*').exec('test')";
# Final image
#============
FROM base as final
# renovate: datasource=github-releases depName=docker lookupName=moby/moby
RUN install-tool docker 20.10.7
ENV RENOVATE_BINARY_SOURCE=docker
COPY --from=tsbuild /usr/src/app/package.json package.json
COPY --from=tsbuild /usr/src/app/dist dist
COPY --from=tsbuild /usr/src/app/node_modules node_modules
# exec helper
COPY bin/ /usr/local/bin/
RUN ln -sf /usr/src/app/dist/renovate.js /usr/local/bin/renovate;
RUN ln -sf /usr/src/app/dist/config-validator.js /usr/local/bin/renovate-config-validator;
CMD ["renovate"]
RUN set -ex; \
renovate --version; \
renovate-config-validator; \
node -e "new require('re2')('.*').exec('test')";
ARG RENOVATE_VERSION
LABEL org.opencontainers.image.version="${RENOVATE_VERSION}"
# Numeric user ID for the ubuntu user. Used to indicate a non-root user to OpenShift
USER 1000