Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When building image from repository on Windows 10, impossible to run it then #1432

Open
osso-romain opened this issue Apr 23, 2021 · 2 comments

Comments

@osso-romain
Copy link

Bug Description
When I build the image from the repository on windows with this command : docker build . -t slatedocs/slate
Then it will create an error at the moment of run it, regarding this command : docker run --rm --name slate -p 4567:4567 slatedocs/slate serve

Error is: "/usr/bin/env: ‘bash\r’: No such file or directory"
I did try to remove this line from the script "slate.sh" and "deploy.sh" but then I will get this error : "standard_init_linux.go:219: exec user process caused: exec format error"

But if I use the public image, then everything work fine:
docker pull slatedocs/slate
docker run --rm --name slate -p 4567:4567 slatedocs/slate serve

Im on Windows 10 Professionel, version 19042.928

@justinmerrell
Copy link

The same thing happened to me, the initial look points to an issue with the file system that was used to create the files. Specificly an end of line conflict \r for UNIX vs \r\n for windows.

Like yourself, I ended up just using the public image and mounted the source folder as a volume, and carried on.

@Arash-coder
Copy link

Arash-coder commented Dec 9, 2023

I changed the docker file and it worked for me :

FROM ruby:2.6-slim as build-stage

WORKDIR /srv/slate

COPY Gemfile .
COPY Gemfile.lock .

RUN apt-get update \
    && apt-get install -y --no-install-recommends \
    build-essential \
    git \
    nodejs \
    && gem install bundler \
    && bundle install

COPY . /srv/slate

RUN chmod +x /srv/slate/slate.sh

RUN bundle exec middleman build

FROM node:18-alpine as run-stage

RUN npm i -g live-server

WORKDIR /app

COPY --from=build-stage /srv/slate/build .

EXPOSE 8080

CMD [ "live-server" ]

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

No branches or pull requests

3 participants