Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker build fails #816

Closed
ko0f opened this issue Feb 2, 2022 · 4 comments
Closed

Docker build fails #816

ko0f opened this issue Feb 2, 2022 · 4 comments
Assignees

Comments

@ko0f
Copy link

ko0f commented Feb 2, 2022

Steps to reproduce -

  1. Follow these step in https://docs.osmosis.zone/developing/cli/install.html#install-build-requirements to checkout v6.1.0
  2. docker build -t osmosis -f Dockerfile . --no-cache

Ends up failing with this output -

...
 perl-error-0.17029-3-any downloading...
 libnsl-2.0.0-1-x86_64 downloading...
 which-2.21-5-x86_64 downloading...
 filesystem-2021.12.07-1-x86_64 downloading...
 pacman-mirrorlist-20220116-1-any downloading...
 pambase-20211210-1-any downloading...
checking keyring...
checking package integrity...
error: perl: signature from "Levente Polyak (anthraxx) <[email protected]>" is unknown trust
:: File /var/cache/pacman/pkg/perl-5.34.0-3-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] error: pinentry: signature from "Levente Polyak (anthraxx) <[email protected]>" is unknown trust

:: File /var/cache/pacman/pkg/pinentry-1.2.0-1-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] error: wget: signature from "Levente Polyak (anthraxx) <[email protected]>" is unknown trust
error: failed to commit transaction (invalid or corrupted package (PGP signature))

:: File /var/cache/pacman/pkg/wget-1.21.2-1-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] 
Errors occurred, no packages were upgraded.
The command '/bin/sh -c pacman -Syyu --noconfirm curl make git go gcc linux-headers python base-devel protobuf wget &&     wget -O /genesis.json https://github.com/osmosis-labs/networks/raw/main/osmosis-1/genesis.json' returned a non-zero code: 1

Seems like a trust issue with perl package at Dockerfile step Step 4/14 : RUN pacman -Syyu --noconfirm curl make git go gcc linux-headers python base-devel protobuf wget && wget -O /genesis.json https://github.com/osmosis-labs/networks/raw/main/osmosis-1/genesis.json

This also happens with v6.2.0.

@daniel-farina
Copy link
Contributor

@nikever is working on the docker images build. He should have an update sometime in the next week or so.
Assigned to him for.

Thanks for reporting @ko0f

@niccoloraspa
Copy link
Member

Hey @ko0f,
Are you still facing the issue?
I tried to replicate your steps but it's working for me. At least when building v6.1.0 from/to linux.

In alternative, you could use the following Dockerfile:

# syntax=docker/dockerfile:1

## Build
FROM golang:1.17-buster AS build

WORKDIR /osmosis

COPY go.mod ./
COPY go.sum ./
RUN go mod download

## Add source files
COPY . /osmosis

## Build Osmosis
RUN make build
RUN wget -q -O /osmosis/genesis.json https://github.com/osmosis-labs/networks/raw/main/osmosis-1/genesis.json

## Deploy
FROM gcr.io/distroless/base-debian10

WORKDIR /

COPY --from=build /osmosis/build/osmosisd /osmosisd
COPY --from=build /osmosis/genesis.json /genesis.json

EXPOSE 26656
EXPOSE 26657
EXPOSE 1317   
EXPOSE 9090

ENTRYPOINT ["/osmosisd"]

This creates a distroless Docker image (so you won't have a shell) and will execute osmosisd as an entrypoint

To build the image:

git clone https://github.com/osmosis-labs/osmosis
cd osmosis
git checkout v6.1.0
# Replace Dockerfile with the one above
docker build -t osmosis:test .

Run the container with:

docker run osmosis:test <subcommand> 

In case you need a shell, replace in the Dockerfile above:

## Deploy
FROM gcr.io/distroless/base-debian10

With:

## Deploy
FROM golang:1.17-buster

Build as above but run with:

docker run -ti --entrypoint "/bin/bash" osmosis:test

This setup is currently in development and yet to be properly tested so it's not bulletproof. In case you face any issues, feel free to post here.

@ValarDragon
Copy link
Member

Closed by #869 I believe

Repository owner moved this from 🔍 Needs Review to ✅ Done in Osmosis Chain Development Feb 17, 2022
@ko0f
Copy link
Author

ko0f commented Mar 1, 2022

Build completes successfully now, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

4 participants