Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

invalid optionash: - #4849

Open
Jordan-Volcano opened this issue Nov 14, 2020 · 1 comment
Open

invalid optionash: - #4849

Jordan-Volcano opened this issue Nov 14, 2020 · 1 comment

Comments

@Jordan-Volcano
Copy link

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:

  • leave the build.sh file blank = works
  • remove the "-e" = give the error bad interpreter

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
Copy link

stloc commented Apr 16, 2021

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

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

No branches or pull requests

2 participants