mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-21 18:06:47 +00:00
Build: Respect package-lock when building
Change-type: patch Signed-off-by: Cameron Diver <cameron@balena.io>
This commit is contained in:
parent
d75c58f09d
commit
a92d9cef3d
10
Dockerfile
10
Dockerfile
@ -47,9 +47,9 @@ RUN apt-get update \
|
|||||||
wget \
|
wget \
|
||||||
&& rm -rf /var/lib/apt/lists/
|
&& rm -rf /var/lib/apt/lists/
|
||||||
|
|
||||||
COPY package.json /usr/src/app/
|
COPY package.json package-lock.json /usr/src/app/
|
||||||
|
|
||||||
RUN JOBS=MAX npm install --no-optional --unsafe-perm
|
RUN JOBS=MAX npm ci --no-optional --unsafe-perm || JOBS=MAX npm install --no-optional --unsafe-perm
|
||||||
|
|
||||||
COPY webpack.config.js fix-jsonstream.js hardcode-migrations.js tsconfig.json /usr/src/app/
|
COPY webpack.config.js fix-jsonstream.js hardcode-migrations.js tsconfig.json /usr/src/app/
|
||||||
COPY src /usr/src/app/src
|
COPY src /usr/src/app/src
|
||||||
@ -83,10 +83,12 @@ RUN apt-get update \
|
|||||||
RUN mkdir -p rootfs-overlay && \
|
RUN mkdir -p rootfs-overlay && \
|
||||||
ln -s /lib rootfs-overlay/lib64
|
ln -s /lib rootfs-overlay/lib64
|
||||||
|
|
||||||
COPY package.json /usr/src/app/
|
COPY package.json package-lock.json /usr/src/app/
|
||||||
|
|
||||||
# Install only the production modules that have C extensions
|
# Install only the production modules that have C extensions
|
||||||
RUN JOBS=MAX npm install --production --no-optional --unsafe-perm \
|
# First try to install with npm ci, then fallback to npm install
|
||||||
|
RUN (JOBS=MAX npm ci --production --no-optional --unsafe-perm || \
|
||||||
|
JOBS=MAX npm install --production --no-optional --unsafe-perm) \
|
||||||
&& npm dedupe
|
&& npm dedupe
|
||||||
|
|
||||||
# Remove various uneeded filetypes in order to reduce space
|
# Remove various uneeded filetypes in order to reduce space
|
||||||
|
Loading…
x
Reference in New Issue
Block a user