stephen-fox / chrome-docker

Chrome, in a Docker container.
MIT License
114 stars 84 forks source link

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

Open Cufee opened 4 years ago

Cufee commented 4 years ago

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
Mota-sem commented 4 years ago

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'