0

I'm trying to run simple script inside docker container after start. Initialy previous developer decided to use s6 inside.

#!/usr/bin/execlineb -P

foreground { sleep 2 }
nginx

When i'm trying to start i'm gettings this message

 execlineb: usage: execlineb [ -p | -P | -S nmin | -s nmin ] [ -q | -w | -W ] [ -c commandline ] script args

Looks like something wrong with executing this scripts or with execline.

I'm using docker for windows under windows10, however if somebody else trying to build this container in ubuntu(or any othe linux) evething is ok.

Can anybody help with this kind of problem?

DockerImage: simple alpine

  • How are you actually running this command? Can you include your image's Dockerfile in the question? "Command-line options get misinterpreted" and "it works on Linux but not Windows" sounds like a line-ending problem. – David Maze Feb 28 '20 at 11:44
  • I cannot publish full dockerfile, i'm trying to run theese commangs. COPY ./docker/ / , my scripts with execlineb stored under "docker" folder, next i'm using ENTRYPOINT ["/init"] to run all files inside folder. – Ivan Kirichuk Mar 02 '20 at 05:23

1 Answers1

0

According to our research of this "HUGE" problem we found two ways to solve it. Definitely it's a problem with special symbols, like '\r'

Option 1 dostounix:

  1. install dostounix in your container(in docker file)

    RUN apk --no-cache add \ dos2unix \

  2. run it againts your sh script.

    RUN for file in {PathToYourFiles}; do \ dos2unix $file; \ chmod a+xwr $file; \ done

  3. enjoy your scripts.

Option 2 VsCode(or any textEditor):

  1. Change CRLF 'End Of Line Sequence' to LF VS Code bottom panel Line endings options
  2. enjoy your scripts.