Working around cargo/debian bugs

This commit is contained in:
Will Hunt 2021-11-21 12:52:05 +00:00
parent 39c6e81cbb
commit 5bdd5c40ca

View File

@ -1,17 +1,20 @@
# Stage 0: Build the thing # Stage 0: Build the thing
# Need debian based image to make node happy # Need debian based image to build the native rust module
# as musl doesn't support cdylib
FROM node:16 AS builder FROM node:16 AS builder
COPY . /src COPY . /src
WORKDIR /src WORKDIR /src
RUN apk add rustup RUN apt update && apt install -y rustc cargo git
RUN rustup-init -y --target x86_64-unknown-linux-gnu # RUN rustup-init -y --target x86_64-unknown-linux-gnu
ENV PATH="/root/.cargo/bin:${PATH}" ENV PATH="/root/.cargo/bin:${PATH}"
# will also build # will also build
RUN yarn RUN yarn --ignore-scripts
# Workaround for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=998232#10
RUN CARGO_NET_GIT_FETCH_WITH_CLI=true yarn build:app:rs --target x86_64-unknown-linux-gnu
# Stage 1: The actual container # Stage 1: The actual container
FROM node:16-alpine FROM node:16-alpine