docker / machine

Machine management for a container-centric world
https://docs.docker.com/machine/
Apache License 2.0
6.62k stars 1.97k forks source link

invalid optionash: - #4849

Open Jordan-Volcano opened 3 years ago

Jordan-Volcano commented 3 years ago

Hi everyone,

I'm new with docker, so sorry if this is a noob question :(

A friend share with me his project and I'm trying to create the container but I have an error.

Here is my input :

docker build -t project-py -f project-py/prod/Dockerfile .

And here is the error :

 => ERROR [19/27] RUN build.sh                                                                                     0.2s
------
 > [19/27] RUN build.sh:
#23 0.195 /bin/bash: - : invalid option
------
failed to solve with frontend dockerfile.v0: failed to build LLB: executor failed running [/bin/sh -c build.sh]: runc did not terminate sucessfully

What I understand so far is he doesn't understand this line in my build.sh : #!/bin/bash -e

I have done some test:

My friend doesn't have the error...

I'm working on W10 build 2004 on a surface Pro 7, with this version of docker :

Client: Docker Engine - Community
 Cloud integration: 1.0.2
 Version:           19.03.13
 API version:       1.40
 Go version:        go1.13.15
 Git commit:        4484c46d9d
 Built:             Wed Sep 16 17:00:27 2020
 OS/Arch:           windows/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.13
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       4484c46d9d
  Built:            Wed Sep 16 17:07:04 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.3.7
  GitCommit:        8fba4e9a7d01810a393d5d25a3621dc101981175
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

Thanks a lot for your help

stloc commented 3 years ago

I have same error

: invalid optionash: -

my bash : RUN chmod u+x /tmp/do_we_need_xdebug.sh && /tmp/do_we_need_xdebug.sh

# do_we_need_xdebug.sh
#!/bin/bash -x

if [ "$ENV" == "dev" ] || [ "$ENV" == "test" ]; then
    pecl install xdebug
    mv /tmp/xdebug.ini /usr/local/etc/php/conf.d/
else
    rm /tmp/xdebug.ini
fi

I use Docker with wsl