generated from oci/template
Some checks failed
Build Docker Image on Commit / build-and-publish (push) Failing after 1m0s
53 lines
No EOL
1.3 KiB
Docker
53 lines
No EOL
1.3 KiB
Docker
# Stage 1: Builder
|
|
FROM node:18-bullseye-slim as builder
|
|
|
|
RUN DEBIAN_FRONTEND=noninteractive \
|
|
&& apt-get update \
|
|
&& apt-get upgrade -yqq \
|
|
&& apt-get install --no-install-recommends -y \
|
|
build-essential \
|
|
curl \
|
|
ca-certificates \
|
|
llvm-13 \
|
|
llvm-13-dev \
|
|
libclang-common-13-dev \
|
|
zlib1g-dev \
|
|
git \
|
|
&& apt-get clean \
|
|
&& rm -fr /var/lib/apt/lists/*
|
|
|
|
ENV PATH="/usr/lib/llvm-13/bin/:${PATH}"
|
|
|
|
# Install Rust
|
|
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y
|
|
ENV PATH="/root/.cargo/bin:${PATH}"
|
|
RUN rustup target add wasm32-unknown-unknown
|
|
|
|
# NodeJS/NPM Dependencies
|
|
RUN npx --package typescript tsc --init
|
|
RUN npm install --global webpack
|
|
RUN npm install --global webpack-cli
|
|
RUN npm install @msgpack/msgpack
|
|
RUN npm install bs58
|
|
|
|
# Clone and build freenet-core
|
|
WORKDIR /src
|
|
RUN git clone https://github.com/freenet/freenet-core.git freenet
|
|
WORKDIR /src/freenet/crates/core
|
|
RUN cargo install --path .
|
|
|
|
# Stage 2: Runner
|
|
FROM debian:bullseye-slim
|
|
|
|
RUN DEBIAN_FRONTEND=noninteractive \
|
|
&& apt-get update \
|
|
&& apt-get upgrade -yqq \
|
|
&& apt-get install --no-install-recommends -y \
|
|
ca-certificates \
|
|
&& apt-get clean \
|
|
&& rm -fr /var/lib/apt/lists/*
|
|
|
|
# Copy the built binary from the builder stage
|
|
COPY --from=builder /root/.cargo/bin/freenet /usr/local/bin/freenet
|
|
|
|
CMD ["freenet", "-b", "0.0.0.0"] |