chrome-docker icon indicating copy to clipboard operation
chrome-docker copied to clipboard

/bin/sh: 1: /bootstrap.sh: not found

Open Cufee opened this issue 4 years ago • 1 comments

When running on Widows after building with Docker or Gradle docker run -p 5900:5900 --name chrome --user apps --privileged local/chrome:0.0.1

Here is a file tree

│   .gitignore
│   build.gradle
│   gradle.properties
│   gradlew
│   gradlew.bat
│   LICENSE.md
│   README.md
│   settings.gradle
│
├───.gradle
│   └───3.3
│       └───taskArtifacts
│               taskArtifacts.lock
│
├───docs
│   ├───building
│   │       README.md
│   │
│   └───configuration
│           README.md
│
├───gradle
│   └───wrapper
│           gradle-wrapper.jar
│           gradle-wrapper.properties
│
└───image
        bootstrap.sh
        Dockerfile

Cufee avatar Apr 15 '20 13:04 Cufee

Windows uses the two-character sequence CR LF in bootstrap.sh. You just need to remove all \r, or just use my Dockerfile:

FROM ubuntu:16.04

RUN apt-get update && apt-get clean && apt-get install -y \
    x11vnc \
    xvfb \
    fluxbox \
    wmctrl \
    wget \
    && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
    && echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list \
    && apt-get update && apt-get -y install google-chrome-stable

RUN useradd apps \
    && mkdir -p /home/apps \
    && chown -v -R apps:apps /home/apps

COPY bootstrap.sh /

RUN sed -i -e 's/\r$//' bootstrap.sh \
	&& chmod +x bootstrap.sh

CMD './bootstrap.sh'

Mota-sem avatar May 22 '20 19:05 Mota-sem