From 9dc84ef9438e32a40df4274de79f72abe6d6d9a7 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Wed, 10 Jul 2024 14:36:09 +0000 Subject: [PATCH] Replace alpine with ubuntu as base image in the Dockerfile (#31) Part of [Create a public laconicd testnet](https://www.notion.so/Create-a-public-laconicd-testnet-896a11bdd8094eff8f1b49c0be0ca3b8) Co-authored-by: Nabarun Reviewed-on: https://git.vdb.to/cerc-io/laconic2d/pulls/31 Co-authored-by: Prathamesh Musale Co-committed-by: Prathamesh Musale --- Dockerfile | 18 +++++++++--------- scripts/init.sh | 1 - tests/sdk_tests/docker-compose.yml | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5d6278bb..2f527b4c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,4 @@ -FROM golang:alpine AS build-env - -# Install dependencies -RUN apk add --update git build-base linux-headers +FROM golang:1.21-bullseye AS builder # Set working directory for the build WORKDIR /go/src/git.vdb.to/cerc-io/laconicd @@ -17,13 +14,16 @@ COPY . . RUN make build # Final image -FROM alpine:3.17.0 +FROM ubuntu:22.04 -# Install ca-certificates -RUN apk add --update ca-certificates jq curl bash +# Install ca-certificates, jq, curl, bash, and other necessary packages +RUN apt-get update && apt-get install -y --no-install-recommends \ + ca-certificates \ + jq curl netcat bash \ + && rm -rf /var/lib/apt/lists/* -# Copy over binaries from the build-env -COPY --from=build-env /go/src/git.vdb.to/cerc-io/laconicd/build/laconicd /usr/bin/laconicd +# Copy over binary from the builder +COPY --from=builder /go/src/git.vdb.to/cerc-io/laconicd/build/laconicd /usr/bin/laconicd WORKDIR / diff --git a/scripts/init.sh b/scripts/init.sh index 847d36bd..4b9225e3 100755 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -15,7 +15,6 @@ if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconicd/data/blockstore.db" ]; then # remove existing daemon and client rm -rf $HOME/.laconicd/* - rm -rf $HOME/.laconic/* if [ -n "`which make`" ]; then make install diff --git a/tests/sdk_tests/docker-compose.yml b/tests/sdk_tests/docker-compose.yml index a4b36ea8..8982d7de 100644 --- a/tests/sdk_tests/docker-compose.yml +++ b/tests/sdk_tests/docker-compose.yml @@ -2,7 +2,7 @@ services: laconicd: restart: unless-stopped image: cerc/laconicd:local - entrypoint: ["sh", "/docker-entrypoint-scripts.d/create-fixturenet.sh"] + entrypoint: ["bash", "/docker-entrypoint-scripts.d/create-fixturenet.sh"] environment: - TEST_AUCTION_ENABLED - TEST_REGISTRY_EXPIRY