ContainerSolutions / minimesos

The experimentation and testing tool for Apache Mesos - NO LONGER MAINTANED!
https://www.minimesos.org
Apache License 2.0
429 stars 61 forks source link

mkdir /usr/local/bin/docker: file exists. #504

Closed yangboz closed 7 years ago

yangboz commented 7 years ago

0.Docker ToolBox1.21.1 beta

1.First off, install:

smartkit@localhost:~/git/gs-spring-boot-docker/complete$ curl https://raw.githubusercontent.com/ContainerSolutions/minimesos/master/bin/install | bash % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 1480 100 1480 0 0 425 0 0:00:03 0:00:03 --:--:-- 425 Installing version 0.10.2 minimesos is installed into /Users/smartkit/.minimesos/bin/minimesos Run the following command to add it to your executables path:

2.Then running it:

export PATH=$PATH:/Users/smartkit/.minimesos/bin smartkit@localhost:~/git/gs-spring-boot-docker/complete$ minimesos up -bash: minimesos: command not found smartkit@localhost:~/git/gs-spring-boot-docker/complete$ export PATH=$PATH:/Users/smartkit/.minimesos/bin smartkit@localhost:~/git/gs-spring-boot-docker/complete$ minimesos up Pulling containersol/minimesos-cli:0.10.2 0.10.2: Pulling from containersol/minimesos-cli 6c123565ed5e: Pull complete 9c857bc97407: Pull complete d75c878941b8: Pull complete bd8fa145a52e: Pull complete Digest: sha256:3a1d8876f6b9ab0235d24264376309e54e43dcf7d5f01b826fcc756224b21173

3.Last error thown:

Status: Downloaded newer image for containersol/minimesos-cli:0.10.2 Created minimesos directory at /Users/smartkit/git/gs-spring-boot-docker/complete/.minimesos. docker: Error response from daemon: mkdir /usr/local/bin/docker: file exists.

adam-sandor commented 7 years ago

Hi @yangboz !

Can you give some details about your system pls? OS and way of running docker (Docker4Mac vs DockerMachine). The last line looks very strange...

smartkit commented 7 years ago

smartkit@zhou-YangbomatoiMac:~/mesos/build$ docker info Containers: 20 Running: 0 Paused: 0 Stopped: 20 Images: 83 Server Version: 1.12.1 Storage Driver: aufs Root Dir: /var/lib/docker/aufs Backing Filesystem: extfs Dirs: 308 Dirperm1 Supported: true Logging Driver: json-file Cgroup Driver: cgroupfs Plugins: Volume: local Network: host overlay null bridge Swarm: inactive Runtimes: runc Default Runtime: runc Security Options: seccomp Kernel Version: 4.4.20-moby Operating System: Alpine Linux v3.4 OSType: linux Architecture: x86_64 CPUs: 2 Total Memory: 1.953 GiB Name: moby ID: GL26:GNU5:AODU:HGJ7:JDGO:HZGR:HDLA:T6SQ:3UNM:64PR:ZNOH:LAVA Docker Root Dir: /var/lib/docker Debug Mode (client): false Debug Mode (server): true File Descriptors: 16 Goroutines: 27 System Time: 2016-09-16T12:21:36.707812191Z EventsListeners: 1 No Proxy: *.local、169.254/16 Username: smartkit Registry: https://index.docker.io/v1/ Experimental: true Insecure Registries: 127.0.0.0/8

@adam-sandor any idea?

adam-sandor commented 7 years ago

I think this is the same issue with Docker4mac as #488 I will look into this when I get the time, until then you can use DockerMachine. There is a known issue with D4M preventing access to containers by their IP addresses, so it's not advised to use it anyway.

kyleprager commented 7 years ago

I am also having this issue - cannot mount /usr/local/bin/docker into my Docker container to run Docker from inside the container. I am starting to build a Jenkins server inside Docker.. I am running Docker4Mac (Version 1.12.1 (build: 12133) 2d5b4d9c3daa089e3869e6355a47dd96dbf39856), and here is the docker-compose I am using to run:

version: '2'

services:
  jenkinsmaster:
#    build: .
    image: ubuntu
    ports:
      - "50000:50000"
      - "8080:8080"
    privileged: true
    environment:
      - DOCKER_HOST=unix://var/run/docker.sock
    volumes:
      # allow Jenkins to spawn child containers
      - /var/run/docker.sock:/var/run/docker.sock
      - /usr/local/bin/docker:/data/docker
      - jenkins_jenkins_data:/var/jenkins_home

volumes:
  jenkins_jenkins_data:
    driver: local

The error is the following:

$>  docker-compose up --force-recreate
Removing alpinejenkinsdockeroraclejava7_jenkinsmaster_1
Recreating 2dded479b933_alpinejenkinsdockeroraclejava7_jenkinsmaster_1

ERROR: for jenkinsmaster  Cannot start service jenkinsmaster: mkdir /usr/local/bin/docker: file exists
ERROR: Encountered errors while bringing up the project.

This works online for lots of people using Boot2Docker (Linux VM running docker), but appears to not work when running native Docker4Mac.

miroswan commented 7 years ago

I was able to get the script to run by removing the -v flag to mount the binary to the container. Check your minimesos file.

miroswan commented 7 years ago

Also, when using docker for mac, your host IP will typically be 0.0.0.0...so any reachable IP on your mac.

frankscholten commented 7 years ago

@miroswan @yangboz @kyleprager A fix was merged into master a few weeks back which removed the volume to mount the binary.

See https://github.com/ContainerSolutions/minimesos/commit/92ee0869a20b1b9861935baf7b8371113ae58a86

Does this solve the issue? If so I will close this one.