2022-07-15 20:09:53 +00:00
|
|
|
ARG IPFS_VERSION=0.13.1
|
2022-06-21 08:08:30 +00:00
|
|
|
ARG CERAMIC_VERSION=2.3.x
|
|
|
|
ARG GLAZED_VERSION=0.2.x
|
2022-07-15 19:43:07 +00:00
|
|
|
ARG GETH_VERSION=1.10
|
|
|
|
ARG BITCOIN_CLI_VERSION=23.0
|
2021-06-24 13:47:13 +00:00
|
|
|
|
2022-07-15 19:43:07 +00:00
|
|
|
# prepare stage images
|
|
|
|
# ----------------------------------------------------------------------------
|
2023-06-05 15:05:24 +00:00
|
|
|
FROM --platform=$TARGETPLATFORM ethereum/client-go:release-${GETH_VERSION} as prepare-geth
|
|
|
|
FROM --platform=$TARGETPLATFORM ipfs/go-ipfs:v${IPFS_VERSION} as prepare-ipfs
|
2021-06-24 13:47:13 +00:00
|
|
|
|
2023-06-05 15:05:24 +00:00
|
|
|
FROM --platform=$TARGETPLATFORM alpine as prepare-bitcoin
|
|
|
|
ARG TARGETPLATFORM
|
|
|
|
ARG BUILDPLATFORM
|
2022-07-15 19:43:07 +00:00
|
|
|
ARG BITCOIN_CLI_VERSION
|
2023-06-05 15:05:24 +00:00
|
|
|
|
2022-07-15 19:43:07 +00:00
|
|
|
# Download checksums
|
|
|
|
ADD https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_CLI_VERSION}/SHA256SUMS ./
|
2023-06-05 15:05:24 +00:00
|
|
|
|
|
|
|
# Download bitcoin archive
|
|
|
|
COPY docker/download_bitcoin_cli.sh /docker/download_bitcoin_cli.sh
|
|
|
|
RUN /docker/download_bitcoin_cli.sh
|
2021-06-24 13:47:13 +00:00
|
|
|
|
2022-07-15 19:43:07 +00:00
|
|
|
# minimal
|
|
|
|
# ----------------------------------------------------------------------------
|
2023-06-05 15:05:24 +00:00
|
|
|
FROM --platform=$TARGETPLATFORM ghcr.io/linuxserver/baseimage-ubuntu:jammy as minimal
|
|
|
|
ARG TARGETPLATFORM
|
|
|
|
ARG BUILDPLATFORM
|
2022-07-15 19:43:07 +00:00
|
|
|
|
|
|
|
# https://github.com/opencontainers/image-spec/blob/main/annotations.md#pre-defined-annotation-keys
|
2023-06-05 15:05:24 +00:00
|
|
|
LABEL org.opencontainers.image.base.name="ghcr.io/linuxserver/baseimage-ubuntu:jammy"
|
2023-06-06 20:52:27 +00:00
|
|
|
LABEL org.opencontainers.image.url="https://github.com/fluencelabs/nox-distro"
|
2022-07-15 19:43:07 +00:00
|
|
|
LABEL org.opencontainers.image.vendor="fluencelabs"
|
2021-08-24 14:05:53 +00:00
|
|
|
LABEL maintainer="fluencelabs"
|
2022-07-15 19:43:07 +00:00
|
|
|
LABEL org.opencontainers.image.authors="fluencelabs"
|
2023-06-06 20:52:27 +00:00
|
|
|
LABEL org.opencontainers.image.title="Fluence nox distro"
|
|
|
|
LABEL org.opencontainers.image.description="Minimal image containing only nox itself"
|
2021-06-24 13:47:13 +00:00
|
|
|
|
|
|
|
ENV RUST_LOG="info,aquamarine=warn,tokio_threadpool=info,tokio_reactor=info,mio=info,tokio_io=info,soketto=info,yamux=info,multistream_select=info,libp2p_secio=info,libp2p_websocket::framed=info,libp2p_ping=info,libp2p_core::upgrade::apply=info,libp2p_kad::kbucket=info,cranelift_codegen=info,wasmer_wasi=info,cranelift_codegen=info,wasmer_wasi=info"
|
|
|
|
ENV RUST_BACKTRACE="1"
|
2021-09-02 09:48:48 +00:00
|
|
|
## set /run_fluence as the CMD binary
|
2021-06-30 20:37:58 +00:00
|
|
|
ENV S6_CMD_ARG0="/run_fluence"
|
2021-06-24 13:47:13 +00:00
|
|
|
|
2023-06-12 07:54:22 +00:00
|
|
|
RUN \
|
2022-07-15 19:43:07 +00:00
|
|
|
apt-get update && \
|
|
|
|
apt-get install -y --no-install-recommends \
|
|
|
|
jq \
|
|
|
|
less \
|
|
|
|
logrotate \
|
2023-06-12 07:54:22 +00:00
|
|
|
curl wget && \
|
|
|
|
apt-get clean && \
|
|
|
|
rm -rf \
|
|
|
|
/tmp/* \
|
|
|
|
/var/lib/apt/lists/* \
|
|
|
|
/var/tmp/*
|
2022-07-15 19:43:07 +00:00
|
|
|
|
2022-09-24 06:57:07 +00:00
|
|
|
# install missing libssl
|
2023-06-05 15:05:24 +00:00
|
|
|
COPY docker/install_libssl.sh /docker/install_libssl.sh
|
|
|
|
RUN /docker/install_libssl.sh
|
2022-09-24 06:57:07 +00:00
|
|
|
|
2022-11-21 10:44:12 +00:00
|
|
|
# aqua-ipfs builtin default env variables
|
|
|
|
# instruct aqua-ipfs (client) to work with an IPFS node hosted on ipfs.fluence.dev
|
|
|
|
ENV FLUENCE_ENV_AQUA_IPFS_EXTERNAL_API_MULTIADDR=/dns4/ipfs.fluence.dev/tcp/5001
|
|
|
|
ENV FLUENCE_ENV_AQUA_IPFS_LOCAL_API_MULTIADDR=/dns4/ipfs.fluence.dev/tcp/5001
|
|
|
|
|
2023-04-27 14:22:37 +00:00
|
|
|
# connector[decider] builtin default env variables
|
2023-03-31 13:58:52 +00:00
|
|
|
# 'true' means to join all deals
|
|
|
|
# 'false' means to join no deals and disable connector completely
|
|
|
|
ENV FLUENCE_ENV_CONNECTOR_JOIN_ALL_DEALS=true
|
2023-05-30 11:55:20 +00:00
|
|
|
# instruct decider which api endpoint to poll
|
2023-05-30 17:39:36 +00:00
|
|
|
ENV FLUENCE_ENV_CONNECTOR_API_ENDPOINT=https://testnet.aurora.dev
|
2023-04-27 14:22:37 +00:00
|
|
|
# deal contract address
|
|
|
|
ENV FLUENCE_ENV_CONNECTOR_CONTRACT_ADDRESS=0xb497e025D3095A197E30Ca84DEc36a637E649868
|
2023-05-30 17:39:36 +00:00
|
|
|
# find deals from this block
|
|
|
|
ENV FLUENCE_ENV_CONNECTOR_FROM_BLOCK=0x75f3fbc
|
2023-03-31 13:58:52 +00:00
|
|
|
|
2023-06-06 20:52:27 +00:00
|
|
|
# download nox binary, builtins
|
2023-06-05 15:05:24 +00:00
|
|
|
COPY fluence/ /fluence/
|
|
|
|
RUN /fluence/download_fluence.sh /fluence/fluence.json
|
2022-07-15 19:43:07 +00:00
|
|
|
|
|
|
|
# copy default fluence config
|
|
|
|
COPY fluence/Config.default.toml /.fluence/v1/Config.toml
|
2023-04-10 14:40:50 +00:00
|
|
|
ENV FLUENCE_CONFIG=/.fluence/v1/Config.toml
|
2022-07-15 19:43:07 +00:00
|
|
|
|
2022-08-18 10:16:09 +00:00
|
|
|
# copy IPFS binary
|
|
|
|
COPY --from=prepare-ipfs /usr/local/bin/ipfs /usr/bin/ipfs
|
|
|
|
|
2022-07-15 19:43:07 +00:00
|
|
|
# copy s6 configs
|
|
|
|
COPY s6/minimal/ /
|
|
|
|
|
|
|
|
# ipfs
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
FROM minimal as ipfs
|
2023-06-05 15:05:24 +00:00
|
|
|
ARG TARGETPLATFORM
|
|
|
|
ARG BUILDPLATFORM
|
2022-07-15 19:43:07 +00:00
|
|
|
|
2023-06-06 20:52:27 +00:00
|
|
|
LABEL org.opencontainers.image.description="nox bundled with IPFS daemon"
|
2022-07-15 19:43:07 +00:00
|
|
|
LABEL dev.fluence.bundles.ipfs="${IPFS_VERSION}"
|
|
|
|
|
2022-07-28 13:33:52 +00:00
|
|
|
ENV IPFS_PATH=/config/ipfs
|
|
|
|
ENV IPFS_LOG_DIR=/log/ipfs
|
|
|
|
ENV IPFS_LOGGING_FMT=nocolor
|
|
|
|
ENV IPFS_MIGRATE_FS=false
|
2022-12-02 11:27:34 +00:00
|
|
|
ENV IPFS_ADDRESSES_SWARM=/ip4/0.0.0.0/tcp/4001,/ip4/0.0.0.0/tcp/4001/ws
|
2022-11-21 10:44:12 +00:00
|
|
|
ENV IPFS_ADDRESSES_API=/ip4/0.0.0.0/tcp/5001
|
|
|
|
ENV IPFS_ADDRESSES_GATEWAY=/ip4/0.0.0.0/tcp/8080
|
2022-12-02 11:27:34 +00:00
|
|
|
ENV IPFS_ADDRESSES_ANNOUNCE=/ip4/127.0.0.1/tcp/4001,/ip4/127.0.0.1/tcp/4001/ws
|
2022-07-15 19:43:07 +00:00
|
|
|
|
2022-08-18 10:16:09 +00:00
|
|
|
# aqua-ipfs builtin default env variables
|
2022-11-21 10:44:12 +00:00
|
|
|
# instruct aqua-ipfs (client) to work with an IPFS node hosted on 127.0.0.1 (inside this docker container)
|
2022-08-18 10:16:09 +00:00
|
|
|
ENV FLUENCE_ENV_AQUA_IPFS_EXTERNAL_API_MULTIADDR=/ip4/127.0.0.1/tcp/5001
|
|
|
|
ENV FLUENCE_ENV_AQUA_IPFS_LOCAL_API_MULTIADDR=/ip4/127.0.0.1/tcp/5001
|
|
|
|
|
2023-06-05 15:05:24 +00:00
|
|
|
# download ipfs fs-repo-migrations tool
|
|
|
|
COPY docker/download_ipfs_fs_repo_migrations.sh /docker/download_ipfs_fs_repo_migrations.sh
|
|
|
|
RUN /docker/download_ipfs_fs_repo_migrations.sh
|
2022-07-15 19:43:07 +00:00
|
|
|
|
|
|
|
# copy s6 configs
|
|
|
|
COPY s6/ipfs/ /
|
|
|
|
|
|
|
|
# expose IPFS node port
|
|
|
|
EXPOSE 5001
|
|
|
|
|
|
|
|
# rich
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
FROM ipfs as rich
|
|
|
|
ARG CERAMIC_VERSION
|
|
|
|
ARG GLAZED_VERSION
|
|
|
|
ARG GETH_VERSION
|
|
|
|
ARG BITCOIN_CLI_VERSION
|
2023-06-05 15:05:24 +00:00
|
|
|
ARG TARGETPLATFORM
|
|
|
|
ARG BUILDPLATFORM
|
2022-07-15 19:43:07 +00:00
|
|
|
|
2023-06-06 20:52:27 +00:00
|
|
|
LABEL org.opencontainers.image.description="nox bundled with IPFS, Ceramic CLI and other tools"
|
2022-07-15 19:43:07 +00:00
|
|
|
LABEL dev.fluence.image.bundles.ceramic="${CERAMIC_VERSION}"
|
|
|
|
LABEL dev.fluence.image.bundles.glazed="${GLAZED_VERSION}"
|
|
|
|
LABEL dev.fluence.image.bundles.bitcoin_cli="${BITCOIN_CLI_VERSION}"
|
|
|
|
LABEL dev.fluence.image.bundles.geth="${GETH_VERSION}"
|
|
|
|
|
|
|
|
# add nodejs 16.x repo
|
2022-06-21 08:08:30 +00:00
|
|
|
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor > /usr/share/keyrings/nodesource.gpg \
|
|
|
|
&& echo "deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_16.x focal main" > /etc/apt/sources.list.d/nodesource.list
|
|
|
|
|
2023-06-12 07:54:22 +00:00
|
|
|
RUN \
|
2022-07-15 19:43:07 +00:00
|
|
|
apt-get update && \
|
|
|
|
apt-get install -y --no-install-recommends \
|
|
|
|
musl \
|
2023-06-12 07:54:22 +00:00
|
|
|
nodejs && \
|
|
|
|
apt-get clean && \
|
|
|
|
rm -rf \
|
|
|
|
/tmp/* \
|
|
|
|
/var/lib/apt/lists/* \
|
|
|
|
/var/tmp/*
|
2021-08-24 14:05:53 +00:00
|
|
|
|
2022-06-21 08:08:30 +00:00
|
|
|
# install ceramic and glaze
|
2023-07-26 18:57:45 +00:00
|
|
|
ENV SHELL=bash
|
|
|
|
ENV PNPM_HOME="/pnpm"
|
|
|
|
ENV PATH="$PNPM_HOME:$PATH"
|
|
|
|
RUN curl -fsSL https://get.pnpm.io/install.sh | sh -
|
|
|
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
|
|
|
|
pnpm install --prod -g \
|
|
|
|
@ceramicnetwork/cli@$CERAMIC_VERSION \
|
|
|
|
@glazed/cli@$GLAZED_VERSION
|
2022-06-21 08:08:30 +00:00
|
|
|
|
2022-07-15 19:43:07 +00:00
|
|
|
# copy geth
|
|
|
|
COPY --from=prepare-geth /usr/local/bin/geth /usr/bin/geth
|
2021-07-08 16:58:39 +00:00
|
|
|
|
2022-07-15 19:43:07 +00:00
|
|
|
# copy bitcoin-cli
|
|
|
|
COPY --from=prepare-bitcoin /bitcoin-${BITCOIN_CLI_VERSION}/bin/bitcoin-cli /usr/bin/bitcoin-cli
|
2021-07-08 16:58:39 +00:00
|
|
|
|
2022-07-15 19:43:07 +00:00
|
|
|
# copy s6 configs
|
|
|
|
COPY s6/rich/ /
|