Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trying to build a docker container, start.sh not found

I'm trying to build a docker container, but it doesn't seem to find my start.sh. It copies it to the container, but it somehow doesnt work.

This is my dockerfile:

FROM ubuntu:16.04

# Install Meteor
RUN apt-get update
RUN apt-get install -y curl
RUN curl https://install.meteor.com/ | sh
RUN meteor npm install --save highcharts

# Entypointscript
COPY start.sh /
RUN chmod u+x /start.sh

# Copy App
COPY /app /app

# UI Expose
EXPOSE 80

ENTRYPOINT /start.sh

And this is my start.sh:

#!/bin/bash

sleep 20
/app/meteor run 

# don't exit 
/usr/bin/tail -f /dev/null

Also I'm not sure about that meteor run command in the start.sh. How do I tell meteor run to be executed in a specific directory, without being able to cd into it?

I'm using Windows 10. I have my meteor app in the \app\ directory and the Dockerfile and start.sh in the same directory as the app folder.

I build the container using: docker build -t meteorapp .

The error when I'm trying to run using:

docker run -p 80:80 --net docker-network --name meteorapp meteorapp

is:

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

Thank you very much!

like image 422
tietze111 Avatar asked Nov 08 '16 13:11

tietze111


1 Answers

I'm also running on Windows 10 and the fix for me was to change line endings from CR LF (windows) to LF (Unix).

I did this with Notepad++ making this very easy and now I can build images. In "Edit" menu of Notepad++, you have "EOL conversion" that does exactly what you need.

like image 122
Mike Averto Avatar answered Sep 30 '22 05:09

Mike Averto