0

I realize similar questions have been answered but nothing has worked for me so far.

I use docker and docker-compose on Windows. I'm trying start a Bash script with parameters.

Here is my dockerfile:

FROM ubuntu
ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y --no-install-recommends apt-utils \
&& apt-get -y install sudo \
&& echo "Set disable_coredump false" >> /etc/sudo.conf \
&& sudo apt-get install -y -q \
&& apt-get -y install python3.8 \
&& apt-get -y install python3.8-dev \
&& apt-get -y install python3-pip \
&& apt-get -y install git \
&& apt-get -y install curl \
&& mkdir prysm && cd prysm \
&& curl https://raw.githubusercontent.com/prysmaticlabs/prysm/master/prysm.sh --output prysm.sh && chmod +x prysm.sh 


ENTRYPOINT ["/bin/bash", "-c", "/prysm/prysm.sh", "beacon-chain", "--config-file=/beacon-config/config.yaml"]

The script prysm.sh starts with:

#!/bin/bash   

...and ends with:

 exec -a "$0" "${process}" "${@:2}"

The whole script can be seen here: https://github.com/prysmaticlabs/prysm/blob/db9e02d7d10ac883df371cbb797ba8d03e88619c/prysm.sh

My docker-compose.yaml file is in the same folder as the dockerfile. Here is its content:


version: "3"
services:
    beacon-node:
        build: .
        ports:
            - "3500:3500"
            - "4000:4000"
            - "8080:8080"
        volumes:
         - ./data:/beacon-node-data
         - ./keys:/beacon-keys
         - ./config:/beacon-config

The command docker-compose up gives me the following result:

Starting ethereum2beaconnode_beacon-node_1 ... done
Attaching to ethereum2beaconnode_beacon-node_1
ethereum2beaconnode_beacon-node_1 exited with code 0

I have tried checking the logs of the container with this command:

docker logs ethereum2beaconnode_beacon-node_1  

But it returns an empty line.

I have tried many thing but nothing worked so far. I am at loss.

1
  • Additionally tot he selected answer, I was missing a step: building with docker-compose. I was on only building with docker. As a consequence docker-compose didn't have the latest image.
    – GaryW
    Commented Aug 1, 2020 at 18:45

1 Answer 1

0

ENTRYPOINT is not correct, replace it with :

CMD ["/prysm/prysm.sh", "beacon-chain", "--config-file=/beacon-config/config.yaml"]

When I ran docker-compose up, I got

Creating docker_beacon-node_1 ... done
Attaching to docker_beacon-node_1
beacon-node_1  | Latest Prysm version is v1.0.0-alpha.17.
beacon-node_1  | Downloading beacon [email protected] to /prysm/dist/beacon-chain-v1.0.0-alpha.17-linux-amd64 (automatically selected latest available version)
beacon-node_1  |   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
beacon-node_1  |                                  Dload  Upload   Total   Spent    Left  Speed
100 42.5M  100 42.5M    0     0  3272k      0  0:00:13  0:00:13 --:--:-- 3316k
beacon-node_1  | Verifying binary integrity.
beacon-node_1  | gpg: key 72E33E4DF1A5036E: public key "Preston Van Loon <[email protected]>" imported
beacon-node_1  | gpg: Total number processed: 1
beacon-node_1  | gpg:               imported: 1
beacon-node_1  | beacon-chain-v1.0.0-alpha.17-linux-amd64: OK
beacon-node_1  | gpg: Signature made Fri Jul 31 03:31:33 2020 UTC
beacon-node_1  | gpg:                using RSA key 0AE0051D647BA3C1A917AF4072E33E4DF1A5036E
beacon-node_1  | gpg: Good signature from "Preston Van Loon <[email protected]>" [unknown]
beacon-node_1  | gpg: WARNING: This key is not certified with a trusted signature!
beacon-node_1  | gpg:          There is no indication that the signature belongs to the owner.
beacon-node_1  | Primary key fingerprint: 0AE0 051D 647B A3C1 A917  AF40 72E3 3E4D F1A5 036E
beacon-node_1  | Verified /prysm/dist/beacon-chain-v1.0.0-alpha.17-linux-amd64 has been signed by Prysmatic Labs.
beacon-node_1  | Starting Prysm beacon-chain --config-file=/beacon-config/config.yaml
Gracefully stopping... (press Ctrl+C again to force)
Stopping docker_beacon-node_1 ... done

with ENTRYPOINT, I got :

Recreating docker_beacon-node_1 ... done
Attaching to docker_beacon-node_1
beacon-node_1  | Usage: ./prysm.sh PROCESS FLAGS.
beacon-node_1  |        ./prysm.sh PROCESS --download-only.
beacon-node_1  | PROCESS can be beacon-chain, validator, or slasher.
docker_beacon-node_1 exited with code 1
1
  • You are right. Your answer works. It started working when I built using: docker-compose build Before that, I would just do: docker build . and then docker-compose up
    – GaryW
    Commented Aug 1, 2020 at 18:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.