Categories
Mastering Development

Starting a docker container with a bash script with parameters (container exited with code 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.

Leave a Reply

Your email address will not be published. Required fields are marked *