-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile.onbuild
28 lines (22 loc) · 1.1 KB
/
Dockerfile.onbuild
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
# Dockerfile.base is included here through the release.sh script
ONBUILD ARG ARTIFACTORY_USER
ONBUILD ARG ARTIFACTORY_NPM_SECRET
ONBUILD ARG ARTIFACTORY_CONTEXT
ONBUILD ARG FAIL_ON_DIRTY_LOCKFILE
ONBUILD ARG YARN_VERSION
# Allow installation as non-root user
ONBUILD RUN npm config set unsafe-perm true
# All but package.json is optional
ONBUILD COPY package.json yarn.lock* .yarnrc* .npmrc* npm-shrinkwrap.json* package-lock.json* pnpm-lock.yaml* ./
# Install dependencies for native builds
# This is in one giant command to keep the image size small
# TODO: When Finnbuild uses Docker 1.13, we can use --squash, which means this won't have to be one giant command
ONBUILD RUN apk upgrade -U && \
apk add --no-cache --virtual build-dependencies make gcc g++ python git || \
apk add --no-cache --virtual build-dependencies make gcc g++ python3 git && \
install-dependencies.sh && \
rm /usr/local/bin/yarn && npm uninstall --loglevel warn --global pnpm && npm uninstall --loglevel warn --global npm && \
apk del build-dependencies
ONBUILD COPY . ./
ONBUILD RUN chown -R node:node .
ONBUILD USER node