godwokenrises / godwoken-kicker

one line command to start godwoken-polyjuice chain.
19 stars 24 forks source link

./kicker: line 103: syntax error: bad function name #310

Closed sleepyyj closed 2 years ago

sleepyyj commented 2 years ago

Subject of the issue

I tried sh ./kicker start in DinD(docker-in-docker) mode and got the error ./kicker: line 103: syntax error: bad function name.

Your environment

Steps to reproduce

  1. create a container from docker:dind image
    docker pull docker:dind
    docker run --privileged -d --name dind-test docker:dind
  2. build an image using the Dockerfile below and create a container with it.
    
    FROM docker:rc-git
    LABEL feliciss = <fiveswind@gmail.com>

Install bash, ncurses, git, curl, yarn, npm, make, cargo, docker, docker-compose and openssl-dev dependency

RUN apk add --no-cache bash ncurses curl yarn npm make docker-compose openssl-dev gcc musl-dev

RUN curl https://sh.rustup.rs -sSf | sh -s -- -y

Add .cargo/bin to PATH

ENV PATH="$HOME/.cargo/bin:${PATH}"

Install cargo packages

RUN cargo install moleculec ckb-capsule

docker build -t test-image . docker run -it test-image -v /var/run/docker.sock:/var/run/docker.sock


3. clone the godwoken-kicker repo and try to start kicker

git clone https://github.com/RetricSu/godwoken-kicker.git cd godwoken-kicker sh ./kicker start


### Expected behavior
start with no error

### Actual behavior
got error `./kicker: line 103: syntax error: bad function name`
keroro520 commented 2 years ago

Thanks for reporting, @sleepyyj. The above error indicates that some functions are not POSIX-compliant. It would work if you switched to bash or zsh shell, such as bash ./kicker start or ./kicker start, for temporarily using.

Are you interested in helping fix this problem? In order to meet POSIX requirements.

See also: https://unix.stackexchange.com/a/168222/227924

sleepyyj commented 2 years ago

Hi, @keroro520. Thanks for your reply. I'm glad to help fix this and I will create a PR maybe tomorrow.