diff --git a/config.json b/config.json index 27b3fea..bf5c6cc 100644 --- a/config.json +++ b/config.json @@ -421,7 +421,7 @@ "root_commands": [ "pip3 install --no-cache-dir --break-system-packages hyperliquid-python-sdk", "mkdir -p /root/bin && curl -sSL https://binaries.hyperliquid.xyz/Testnet/hl-visor -o /root/bin/hl-visor && chmod +x /root/bin/hl-visor", - "git clone --depth 1 https://github.com/hyperliquid-dex/node.git /opt/hyperliquid-node && chmod -R a+r /opt/hyperliquid-node", + "git clone https://github.com/hyperliquid-dex/node.git /opt/hyperliquid-node && cd /opt/hyperliquid-node && git checkout 8a2c4b9e5757aafae5079f8236e3bf6752f7d81b && chmod -R a+r /opt/hyperliquid-node", "/root/bin/hl-visor --help || echo 'Hyperliquid visor installed'" ] } @@ -466,9 +466,9 @@ "gnupg" ], "root_commands": [ - "curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | gpg --dearmor -o /usr/share/keyrings/mongodb-server-7.0.gpg", - "echo 'deb [ signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu noble/mongodb-org/7.0 multiverse' | tee /etc/apt/sources.list.d/mongodb-org-7.0.list", - "apt-get update && apt-get install -y mongodb-org && rm -rf /var/lib/apt/lists/*", + "curl -fsSL https://www.mongodb.org/static/pgp/server-8.0.asc | gpg --dearmor -o /usr/share/keyrings/mongodb-server-8.0.gpg", + "echo 'deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/8.0 multiverse' | tee /etc/apt/sources.list.d/mongodb-org-8.0.list", + "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y mongodb-org && rm -rf /var/lib/apt/lists/*", "mkdir -p /data/db && chmod 777 /data/db", "mongod --version" ] @@ -562,8 +562,8 @@ "PATH": "/root/.tempo/bin:/root/.foundry/bin:/usr/local/cargo/bin:$PATH" }, "root_commands": [ - "git clone --depth 1 https://github.com/tempoxyz/tempo.git /tmp/tempo && cd /tmp/tempo && cargo build --release && mkdir -p /root/.tempo/bin && cp target/release/tempo* /root/.tempo/bin/ 2>/dev/null || echo 'Tempo binaries copied' && chmod -R a+rx /root/.tempo && rm -rf /tmp/tempo", - "echo 'Tempo node built from https://github.com/tempoxyz/tempo'" + "git clone https://github.com/tempoxyz/tempo.git /tmp/tempo && cd /tmp/tempo && git checkout 7e2c66842c2ef99e3f0670c63d9b92df20195af6 && cargo build --release && mkdir -p /root/.tempo/bin && cp target/release/tempo* /root/.tempo/bin/ 2>/dev/null || echo 'Tempo binaries copied' && chmod -R a+rx /root/.tempo && rm -rf /tmp/tempo", + "echo 'Tempo node built from https://github.com/tempoxyz/tempo at 7e2c66842c2ef99e3f0670c63d9b92df20195af6'" ] } }, @@ -876,7 +876,7 @@ "root_commands": [ "curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | gpg --dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg", "echo 'deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/8.x/apt stable main' | tee /etc/apt/sources.list.d/elastic-8.x.list", - "apt-get update && apt-get install -y elasticsearch && rm -rf /var/lib/apt/lists/*", + "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y elasticsearch && rm -rf /var/lib/apt/lists/*", "pip3 install --no-cache-dir --break-system-packages elasticsearch", "echo 'Elasticsearch installed (run with: systemctl start elasticsearch)'" ] @@ -893,7 +893,7 @@ "root_commands": [ "curl -fsSL https://packages.clickhouse.com/rpm/lts/repodata/repomd.xml.key | gpg --dearmor -o /usr/share/keyrings/clickhouse-keyring.gpg", "echo 'deb [signed-by=/usr/share/keyrings/clickhouse-keyring.gpg] https://packages.clickhouse.com/deb stable main' | tee /etc/apt/sources.list.d/clickhouse.list", - "apt-get update && apt-get install -y clickhouse-server clickhouse-client && rm -rf /var/lib/apt/lists/*", + "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y clickhouse-server clickhouse-client && rm -rf /var/lib/apt/lists/*", "pip3 install --no-cache-dir --break-system-packages clickhouse-connect clickhouse-driver", "clickhouse-client --version" ] diff --git a/generate_docker.js b/generate_docker.js index e294add..7d5605b 100755 --- a/generate_docker.js +++ b/generate_docker.js @@ -62,6 +62,22 @@ function formatEnvValue(value) { return /\s/.test(stringValue) ? JSON.stringify(stringValue) : stringValue; } +function normalizeRootCommand(command) { + if (typeof command !== 'string') { + return command; + } + + if (!command.includes('apt-get install')) { + return command; + } + + if (command.includes('DEBIAN_FRONTEND=noninteractive apt-get install')) { + return command; + } + + return command.replace(/apt-get\s+install/g, 'DEBIAN_FRONTEND=noninteractive apt-get install'); +} + function buildCargoInstallCommand(pkg) { if (typeof pkg === 'string') { if (pkg.includes('@')) { @@ -154,7 +170,9 @@ function generateInfraDockerfile(project, config, outputDir) { if (customInstall && customInstall.root_commands && customInstall.root_commands.length > 0) { dockerfileLines.push(`\nUSER root\n`); dockerfileLines.push(`RUN `); - const commands = customInstall.root_commands.join(' && \\\n '); + const commands = customInstall.root_commands + .map(normalizeRootCommand) + .join(' && \\\n '); dockerfileLines.push(`${commands}\n`); dockerfileLines.push(`\nUSER agent\n`); } @@ -291,7 +309,9 @@ function generateCombinedDockerfile(projectNames, outputDir) { if (allRootCommands.length > 0) { dockerfileLines.push(`\nUSER root\n`); dockerfileLines.push(`RUN `); - const commands = allRootCommands.join(' && \\\n '); + const commands = allRootCommands + .map(normalizeRootCommand) + .join(' && \\\n '); dockerfileLines.push(`${commands}\n`); dockerfileLines.push(`\nUSER agent\n`); } diff --git a/infra/clickhouse.Dockerfile b/infra/clickhouse.Dockerfile index cc1cbc6..f83ea20 100644 --- a/infra/clickhouse.Dockerfile +++ b/infra/clickhouse.Dockerfile @@ -3,7 +3,7 @@ FROM base-system:latest USER root RUN curl -fsSL https://packages.clickhouse.com/rpm/lts/repodata/repomd.xml.key | gpg --dearmor -o /usr/share/keyrings/clickhouse-keyring.gpg && \ echo 'deb [signed-by=/usr/share/keyrings/clickhouse-keyring.gpg] https://packages.clickhouse.com/deb stable main' | tee /etc/apt/sources.list.d/clickhouse.list && \ - apt-get update && apt-get install -y clickhouse-server clickhouse-client && rm -rf /var/lib/apt/lists/* && \ + apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y clickhouse-server clickhouse-client && rm -rf /var/lib/apt/lists/* && \ pip3 install --no-cache-dir --break-system-packages clickhouse-connect clickhouse-driver && \ clickhouse-client --version diff --git a/infra/elasticsearch.Dockerfile b/infra/elasticsearch.Dockerfile index c5dda09..0841525 100644 --- a/infra/elasticsearch.Dockerfile +++ b/infra/elasticsearch.Dockerfile @@ -11,7 +11,7 @@ USER agent USER root RUN curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | gpg --dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg && \ echo 'deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/8.x/apt stable main' | tee /etc/apt/sources.list.d/elastic-8.x.list && \ - apt-get update && apt-get install -y elasticsearch && rm -rf /var/lib/apt/lists/* && \ + apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y elasticsearch && rm -rf /var/lib/apt/lists/* && \ pip3 install --no-cache-dir --break-system-packages elasticsearch && \ echo 'Elasticsearch installed (run with: systemctl start elasticsearch)' diff --git a/infra/hyperliquid.Dockerfile b/infra/hyperliquid.Dockerfile index 45ed4b5..8a50a79 100644 --- a/infra/hyperliquid.Dockerfile +++ b/infra/hyperliquid.Dockerfile @@ -5,7 +5,7 @@ ENV PATH=/root/bin:/usr/local/cargo/bin:$PATH USER root RUN pip3 install --no-cache-dir --break-system-packages hyperliquid-python-sdk && \ mkdir -p /root/bin && curl -sSL https://binaries.hyperliquid.xyz/Testnet/hl-visor -o /root/bin/hl-visor && chmod +x /root/bin/hl-visor && \ - git clone --depth 1 https://github.com/hyperliquid-dex/node.git /opt/hyperliquid-node && chmod -R a+r /opt/hyperliquid-node && \ + git clone https://github.com/hyperliquid-dex/node.git /opt/hyperliquid-node && cd /opt/hyperliquid-node && git checkout 8a2c4b9e5757aafae5079f8236e3bf6752f7d81b && chmod -R a+r /opt/hyperliquid-node && \ /root/bin/hl-visor --help || echo 'Hyperliquid visor installed' USER agent diff --git a/infra/mongodb.Dockerfile b/infra/mongodb.Dockerfile index dfc2daa..d253779 100644 --- a/infra/mongodb.Dockerfile +++ b/infra/mongodb.Dockerfile @@ -9,9 +9,9 @@ RUN apt-get update && \ USER agent USER root -RUN curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | gpg --dearmor -o /usr/share/keyrings/mongodb-server-7.0.gpg && \ - echo 'deb [ signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu noble/mongodb-org/7.0 multiverse' | tee /etc/apt/sources.list.d/mongodb-org-7.0.list && \ - apt-get update && apt-get install -y mongodb-org && rm -rf /var/lib/apt/lists/* && \ +RUN curl -fsSL https://www.mongodb.org/static/pgp/server-8.0.asc | gpg --dearmor -o /usr/share/keyrings/mongodb-server-8.0.gpg && \ + echo 'deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/8.0 multiverse' | tee /etc/apt/sources.list.d/mongodb-org-8.0.list && \ + apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y mongodb-org && rm -rf /var/lib/apt/lists/* && \ mkdir -p /data/db && chmod 777 /data/db && \ mongod --version diff --git a/infra/tempo.Dockerfile b/infra/tempo.Dockerfile index ad127bb..893867f 100644 --- a/infra/tempo.Dockerfile +++ b/infra/tempo.Dockerfile @@ -3,8 +3,8 @@ FROM foundry:latest ENV PATH=/root/.tempo/bin:/root/.foundry/bin:/usr/local/cargo/bin:$PATH USER root -RUN git clone --depth 1 https://github.com/tempoxyz/tempo.git /tmp/tempo && cd /tmp/tempo && cargo build --release && mkdir -p /root/.tempo/bin && cp target/release/tempo* /root/.tempo/bin/ 2>/dev/null || echo 'Tempo binaries copied' && chmod -R a+rx /root/.tempo && rm -rf /tmp/tempo && \ - echo 'Tempo node built from https://github.com/tempoxyz/tempo' +RUN git clone https://github.com/tempoxyz/tempo.git /tmp/tempo && cd /tmp/tempo && git checkout 7e2c66842c2ef99e3f0670c63d9b92df20195af6 && cargo build --release && mkdir -p /root/.tempo/bin && cp target/release/tempo* /root/.tempo/bin/ 2>/dev/null || echo 'Tempo binaries copied' && chmod -R a+rx /root/.tempo && rm -rf /tmp/tempo && \ + echo 'Tempo node built from https://github.com/tempoxyz/tempo at 7e2c66842c2ef99e3f0670c63d9b92df20195af6' USER agent