mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-11 22:46:27 +00:00
feat: official Dockerfile (#1619)
Adds a Dockerfile for building with Docker Hub
This commit is contained in:
parent
9ff363251f
commit
0bd192feec
3 changed files with 41 additions and 0 deletions
16
docker/Dockerfile
Normal file
16
docker/Dockerfile
Normal file
|
@ -0,0 +1,16 @@
|
|||
FROM node:8.10.0-alpine
|
||||
|
||||
LABEL maintainer="Rhys Arkins <rhys@arkins.net>"
|
||||
LABEL name="renovate"
|
||||
|
||||
WORKDIR /src
|
||||
|
||||
COPY package.json .
|
||||
COPY yarn.lock .
|
||||
RUN yarn install --production && yarn cache clean
|
||||
COPY lib ./lib
|
||||
RUN chown -R node:node /src
|
||||
USER node
|
||||
|
||||
ENTRYPOINT ["node", "/src/lib/renovate.js"]
|
||||
CMD ["--help"]
|
20
docker/hooks/post_push
Normal file
20
docker/hooks/post_push
Normal file
|
@ -0,0 +1,20 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
SEMVER_REGEX="^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$"
|
||||
|
||||
if ! [[ "$CACHE_TAG" =~ $SEMVER_REGEX ]]; then
|
||||
echo Not a semver tag - skipping
|
||||
exit
|
||||
fi
|
||||
|
||||
major=${BASH_REMATCH[1]}
|
||||
minor=${BASH_REMATCH[2]}
|
||||
|
||||
# Tag and push image for each additional tag
|
||||
for tag in {"$major","${major}.${minor}"}; do
|
||||
echo "Tagging ${DOCKER_REPO}:${tag}"
|
||||
docker tag $IMAGE_NAME ${DOCKER_REPO}:${tag}
|
||||
docker push ${DOCKER_REPO}:${tag}
|
||||
done
|
5
docker/hooks/readme.md
Normal file
5
docker/hooks/readme.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
# Docker Hub hooks
|
||||
|
||||
This directory is required in order to provide a post-push hook to Docker Hub Autobuild.
|
||||
|
||||
See https://docs.docker.com/docker-cloud/builds/advanced/#custom-build-phase-hooks for details.
|
Loading…
Reference in a new issue