mirror of
https://github.com/datahaven-xyz/datahaven
synced 2026-05-24 01:38:32 +00:00
use ARG to build Dockerfile; use local chain everywhere;
This commit is contained in:
parent
d853374259
commit
b258113547
7 changed files with 22 additions and 52 deletions
1
.github/workflows/task-docker-ci.yml
vendored
1
.github/workflows/task-docker-ci.yml
vendored
|
|
@ -75,6 +75,7 @@ jobs:
|
|||
dockerfile: ./operator/Dockerfile
|
||||
context: .
|
||||
registry: ghcr.io
|
||||
build_args: ./build/datahaven-node
|
||||
registry_username: ${{ github.actor }}
|
||||
registry_password: ${{ secrets.GITHUB_TOKEN }}
|
||||
image_tags: ${{ steps.meta.outputs.tags }}
|
||||
|
|
|
|||
|
|
@ -50,4 +50,3 @@ examples/
|
|||
Cargo.lock.old
|
||||
*.toml.old
|
||||
*.lock.old
|
||||
**/target/
|
||||
|
|
@ -1,21 +1,12 @@
|
|||
# DataHaven Operator Image
|
||||
#
|
||||
# This is the standard operator image used for CI and release builds.
|
||||
# It's a minimal image that accepts a pre-built binary.
|
||||
#
|
||||
# Usage:
|
||||
# - CI builds: Binary from build-operator workflow artifact
|
||||
# - Release builds: Binary from build-operator workflow artifact
|
||||
# - Local builds: Binary from local cargo build
|
||||
#
|
||||
# Expected Binary Location:
|
||||
# build/datahaven-node
|
||||
#
|
||||
# Registries:
|
||||
# - GHCR: ghcr.io/datahaven-xyz/datahaven/datahaven (CI)
|
||||
# - DockerHub: datahavenxyz/datahaven (releases)
|
||||
|
||||
FROM debian:stable AS builder
|
||||
FROM debian:stable-slim
|
||||
|
||||
LABEL version="0.4.0"
|
||||
LABEL description="DataHaven Node - Release Build"
|
||||
LABEL maintainer="steve@moonsonglabs.com"
|
||||
|
||||
ARG BINARY_PATH=./target/x86_64-unknown-linux-gnu/release/datahaven-node
|
||||
|
||||
# Install CA certificates and libpq5 for the release build
|
||||
RUN apt-get update && \
|
||||
|
|
@ -26,44 +17,17 @@ RUN apt-get update && \
|
|||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
FROM debian:stable-slim
|
||||
|
||||
LABEL version="0.4.0"
|
||||
LABEL description="DataHaven Node - Release Build"
|
||||
LABEL maintainer="steve@moonsonglabs.com"
|
||||
|
||||
# Copy CA certificates and shared libraries from builder
|
||||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
||||
COPY --from=builder \
|
||||
/lib/x86_64-linux-gnu/libpq.so.5 \
|
||||
/lib/x86_64-linux-gnu/libssl.so.3 \
|
||||
/lib/x86_64-linux-gnu/libcrypto.so.3 \
|
||||
/lib/x86_64-linux-gnu/libgssapi_krb5.so.2 \
|
||||
/lib/x86_64-linux-gnu/libldap.so.2 \
|
||||
/lib/x86_64-linux-gnu/libz.so.1 \
|
||||
/lib/x86_64-linux-gnu/libzstd.so.1 \
|
||||
/lib/x86_64-linux-gnu/libkrb5.so.3 \
|
||||
/lib/x86_64-linux-gnu/libk5crypto.so.3 \
|
||||
/lib/x86_64-linux-gnu/libcom_err.so.2 \
|
||||
/lib/x86_64-linux-gnu/libkrb5support.so.0 \
|
||||
/lib/x86_64-linux-gnu/liblber.so.2 \
|
||||
/lib/x86_64-linux-gnu/libsasl2.so.2 \
|
||||
/lib/x86_64-linux-gnu/libkeyutils.so.1 \
|
||||
/lib/x86_64-linux-gnu/
|
||||
|
||||
# Create datahaven user and directories
|
||||
RUN useradd -m -u 1001 -U -s /bin/sh -d /datahaven datahaven && \
|
||||
mkdir -p /data /datahaven/.local/share && \
|
||||
chown -R datahaven:datahaven /data /datahaven/.local/share && \
|
||||
ln -s /data /datahaven/.local/share/datahaven-node
|
||||
|
||||
mkdir -p /datahaven/.local/share && \
|
||||
chown -R datahaven:datahaven /datahaven/.local/share
|
||||
|
||||
USER datahaven
|
||||
|
||||
# Copy pre-built binary
|
||||
COPY --chown=datahaven:datahaven build/* /usr/local/bin
|
||||
COPY --chown=datahaven:datahaven $BINARY_PATH /usr/local/bin
|
||||
# Make binary executable
|
||||
RUN chmod uog+x /usr/local/bin/datahaven*
|
||||
RUN chmod uog+x /usr/local/bin/datahaven-node
|
||||
|
||||
# Expose ports
|
||||
# 30333: p2p networking
|
||||
|
|
@ -71,6 +35,4 @@ RUN chmod uog+x /usr/local/bin/datahaven*
|
|||
# 9615: Prometheus metrics
|
||||
EXPOSE 30333 9944 9615
|
||||
|
||||
VOLUME ["/data"]
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/datahaven-node"]
|
||||
ENTRYPOINT ["datahaven-node"]
|
||||
|
|
|
|||
|
|
@ -52,6 +52,8 @@ export const launchDatahavenValidator = async (
|
|||
const COMMON_LAUNCH_ARGS = [
|
||||
"--unsafe-force-node-key-generation",
|
||||
"--tmp",
|
||||
"--chain",
|
||||
"local",
|
||||
"--validator",
|
||||
"--discover-local",
|
||||
"--no-prometheus",
|
||||
|
|
|
|||
|
|
@ -159,6 +159,7 @@ export const launchMspNode = async (
|
|||
"-p",
|
||||
`${wsPort}:${DEFAULT_SUBSTRATE_WS_PORT}`,
|
||||
options.datahavenImageTag,
|
||||
"--tmp",
|
||||
"--name",
|
||||
"msp-charlie",
|
||||
"--chain",
|
||||
|
|
@ -246,6 +247,7 @@ export const launchBspNode = async (
|
|||
"-p",
|
||||
`${wsPort}:${DEFAULT_SUBSTRATE_WS_PORT}`,
|
||||
options.datahavenImageTag,
|
||||
"--tmp",
|
||||
"--name",
|
||||
"bsp-dorothy",
|
||||
"--chain",
|
||||
|
|
@ -333,6 +335,7 @@ export const launchIndexerNode = async (
|
|||
"-p",
|
||||
`${wsPort}:${DEFAULT_SUBSTRATE_WS_PORT}`,
|
||||
options.datahavenImageTag,
|
||||
"--tmp",
|
||||
"--name",
|
||||
"indexer",
|
||||
"--chain",
|
||||
|
|
@ -408,6 +411,7 @@ export const launchFishermanNode = async (
|
|||
"-p",
|
||||
`${wsPort}:${DEFAULT_SUBSTRATE_WS_PORT}`,
|
||||
options.datahavenImageTag,
|
||||
"--tmp",
|
||||
"--chain",
|
||||
"local",
|
||||
"--name",
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
"cli": "bun run cli/index.ts",
|
||||
"fmt": "biome check .",
|
||||
"fmt:fix": "biome check --write .",
|
||||
"build:docker:operator": "docker build --no-cache --platform linux/amd64 -t datahavenxyz/datahaven:local -f ../docker/datahaven-dev.Dockerfile ../.",
|
||||
"build:docker:operator": "docker build --no-cache --platform linux/amd64 -t datahavenxyz/datahaven:local -f ../operator/Dockerfile ../operator",
|
||||
"generate:wagmi": "wagmi generate",
|
||||
"generate:snowbridge-cfgs": "bun -e \"import {generateSnowbridgeConfigs} from './scripts/gen-snowbridge-cfgs.ts'; await generateSnowbridgeConfigs()\"",
|
||||
"generate:contracts": "bun -e \"import {generateContracts} from './scripts/generate-contracts.ts'; await generateContracts()\"",
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@
|
|||
export const COMMON_LAUNCH_ARGS = [
|
||||
"--unsafe-force-node-key-generation",
|
||||
"--tmp",
|
||||
"--chain",
|
||||
"local",
|
||||
"--validator",
|
||||
"--discover-local",
|
||||
"--no-prometheus",
|
||||
|
|
|
|||
Loading…
Reference in a new issue