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

docker cannot run because of "container no such file or directory" #9066

Closed
anthonyvialleton opened this issue Nov 10, 2014 · 10 comments
Closed

Comments

@anthonyvialleton
Copy link

I'm unable to start my container after build and I got :

Error response from daemon: Cannot start container ogc-mysql: no such file or directory
Error: failed to start one or more containers

Here is my Docker file :

FROM ubuntu:latest

MAINTAINER Davin Kevin

# Install latest updates
RUN apt-get update
RUN apt-get upgrade -y

# Install mysql client and server
RUN apt-get -y install mysql-client mysql-server curl

# Enable remote access (default is localhost only, we change this
# otherwise our database would not be reachable from outside the container)
RUN sed -i -e"s/^bind-address\s*=\s*127.0.0.1/bind-address = 0.0.0.0/" /etc/mysql/my.cnf

# Install database
ADD ./database.sql /var/db/database.sql

# Set Standard settings
ENV user ogc
ENV password ogc
ENV url file:/var/db/database.sql
ENV right READ

# Install starting script
ADD ./start-database.sh /usr/local/bin/start-database.sh
RUN chmod +x /usr/local/bin/start-database.sh

EXPOSE 3306

CMD ["/usr/local/bin/start-database.sh"]

And my sh script only does :

cd "$(dirname "$BASH_SOURCE")";
docker build -t ogc-mysql .
docker run --name ogc-mysql -d -p 3306:3306 ogc-mysql

uname -a command returns :

Linux boot2docker 3.16.4-tinycore64 #1 SMP Tue Oct 14 01:10:32 UTC 2014 x86_64 GNU/Linux

docker info command returns :

Containers: 0
Images: 21
Storage Driver: aufs
Root Dir: /mnt/sda1/var/lib/docker/aufs
Dirs: 21
Execution Driver: native-0.2
Kernel Version: 3.16.4-tinycore64
Operating System: Boot2Docker 1.3.0 (TCL 5.4); master : a083df4 - Thu Oct 16 17:05:03 UTC 2014
Debug mode (server): true
Debug mode (client): false
Fds: 11
Goroutines: 12
EventsListeners: 0
Init Path: /usr/local/bin/docker

docker version command returns :

Client version: 1.3.0
Client API version: 1.15
Go version (client): go1.3.3
Git commit (client): c78088f
OS/Arch (client): linux/amd64
Server version: 1.3.0
Server API version: 1.15
Go version (server): go1.3.3
Git commit (server): c78088f

@cpuguy83
Copy link
Member

The error message would seem to indicate that there is something missing in the container, which your image is attempting to run.

What does /usr/local/bin/start-database.sh look like?

@anthonyvialleton
Copy link
Author

/usr/local/bin/start-database.sh doesn't exist..

@davinkevin
Copy link

The start-database.sh come from http://www.nkode.io/2014/09/12/easymysql.html

You can see what is inside it here : https://github.com/nkratzke/EasyMySQL/blob/master/start-database.sh

@davinkevin
Copy link

Problem solved, it was a line-ending problem in the sh files...

@duglin
Copy link
Contributor

duglin commented Nov 16, 2014

@davinkevin please close the issue if it is resolved.

@davinkevin
Copy link

I don't have the right to close the issue, @anthonyvialleton has to do it I think.

@duglin
Copy link
Contributor

duglin commented Nov 16, 2014

oops sorry - for some reason I thought you opened it - totally misread it :-)

@jdoliner
Copy link
Contributor

Can anyone clarify what the line-ending problem was? I'm getting a similar behavior with a binary file and can't figure out how to fix it.

@abacaj
Copy link

abacaj commented Nov 6, 2015

for anyone else ending up here from google.. I edited my docker file on a windows machine but the cryptic error message Error response from daemon: Cannot start container 4684e235133a0393292cd39f5b875ba8597e21ad2b4360ddbb172b297fa733d8: [8] System error: no such file or directory turned out to be a line ending issue as described in this post.

I removed all new lines at end of file and changed line endings in sublime text view -> line endings -> unix, previously it was set to windows.

@mmoayyed
Copy link

Thanks @abacaj Your post was very helpful!

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

7 participants