Docker Community Forums

Share and learn in the Docker community.

Docker for Mac startup delay problems

docker

(Onni Hakala) #1

Hey!

I need docker to be available asap in system start so I can run custom dns server inside a container in Docker for Mac.

Expected behavior

I would want to run $ docker ps -a immediately after system startup.

I would want to ping the docker VM immediately: $ ping docker.local

This actually works with dlite: https://github.com/nlf/dlite so maybe check how it starts the system daemon.

Actual behavior

$ ping docker.local
ping: cannot resolve moi.local: Unknown host

$ docker ps -a
Cannot connect to the Docker daemon. Is the docker daemon running on this host?

After waiting for couple of minutes they work correctly:

$ ping docker.local
PING docker.local (192.168.64.7): 56 data bytes
64 bytes from 192.168.64.7: icmp_seq=0 ttl=64 time=0.349 ms

$ docker ps -a
CONTAINER ID        IMAGE                COMMAND                  CREATED             STATUS                      PORTS                                                NAMES

Information

$ pinata diagnose -u
OS X: version 10.11.4 (build: 15E65)
Docker.app: version v1.11.0-beta8.2
Running diagnostic tests:
[OK]      docker-cli
[OK]      Moby booted
[OK]      driver.amd64-linux
[OK]      vmnetd
[OK]      osxfs
[OK]      db
[OK]      slirp
[OK]      menubar
[OK]      environment
[OK]      Docker
[OK]      VT-x
Docker logs are being collected into /tmp/20160424-135542.tar.gz
Most specific failure is: No error was detected
Your unique id is: A731BA56-0FD3-4DB4-B2A1-AAB15DB2F7E6
Please quote this in all correspondence.

Steps to reproduce the behavior

I installed Docker for Mac and enabled it in system login:


(Kristoffer Peterhänsel) #2

So when you say “immediately after system startup” do you mean you don’t want to log into the GUI of the system first? Since the “login items” in your account is only actually run as part of the user logging in to the GUI. And not if you would, say, SSH into the system. For it to run after the machine has booted a Launch Daemon file would have to be made and installed.

But the use-case for that is a bit hard to spot. Docker for Mac seems to be a tool to make it easier to use Docker when you develop with it in some way. It’s still starting up a VM that runs a Linux. So while you seems to have a use-case where it make sense for you. I think in most scenarios people would want to run an actual Linux-box if they want to have Docker available for something mission-critical.


(Onni Hakala) #3

Good points! This is not mission-critical but really helpful and nice for local development. I guess I’m just sticking with dlite then.