Docker Community Forums

Share and learn in the Docker community.

Docker for Mac - IP change to "None" after update

docker

(Silas Ribas Martins) #1

After update Docker for Mac to beta8 version, the ip of container with nginx is change to “None”:

CONTAINER ID        IMAGE                       COMMAND                CREATED             STATUS              PORTS                      NAMES
e33db80d9a4f        phpdockerio/nginx:latest    "/usr/sbin/nginx"      45 seconds ago      Up 44 seconds       None:80->80/tcp, 443/tcp   sistema-webserver
c9111c0bd1e7        phpdocker_sistema-php-fpm   "/usr/sbin/php5-fpm"   46 seconds ago      Up 44 seconds       9000/tcp                   sistema-php-fpm

In beta7:

CONTAINER ID        IMAGE                       COMMAND                CREATED              STATUS              PORTS                              NAMES
6345da422c17        phpdockerio/nginx:latest    "/usr/sbin/nginx"      About a minute ago   Up About a minute   192.168.64.4:80->80/tcp, 443/tcp   sistema-webserver
04e664b17d6d        phpdocker_sistema-php-fpm   "/usr/sbin/php5-fpm"   About a minute ago   Up About a minute   9000/tcp                           sistema-php-fpm

Expected behavior

Access docker.local normally.

Actual behavior

docker.local not load.

Information

:cloud: phpdocker pinata diagnose -u
OS X: version 10.10.5 (build: 14F1021)
Docker.app: version v1.11.0-beta7
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/20160420-213508.tar.gz
Most specific failure is: No error was detected
Your unique id is: 0E8A6B3F-0B93-40F8-90C5-5397B62D1C8C
Please quote this in all correspondence.

Steps to reproduce the behavior

  1. Update to beta8
  2. docker-composer up -d

Files used:
docker-composer.yml

sistema-webserver:
  image: phpdockerio/nginx:latest
  container_name: sistema-webserver
  volumes:
      - ../sistema:/var/www/sistema
      - ./nginx/vhost.conf:/etc/nginx/conf.d/default.conf
      - ./nginx/nginx.conf:/etc/nginx/nginx.conf
  ports:
   - "80:80"
  links:
   - sistema-php-fpm

nginx/vhost.conf

server {
    listen 80 default;
    server_name docker.local;

    client_max_body_size 508M;

    access_log /var/log/nginx/sistema.access.log;
    error_log  /var/log/nginx/error.log;


    root /var/www/sistema/public;
    index index.php;

    if (!-e $request_filename) {
        rewrite ^.*$ /index.php last;
    }

    location ~ \.php$ {
        fastcgi_pass sistema-php-fpm:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PHP_VALUE "error_log=/var/log/nginx/sistema_php_errors.log";
        fastcgi_param APPLICATION_ENV development;
        fastcgi_buffers 16 16k;
        fastcgi_buffer_size 32k;
        include fastcgi_params;
        fastcgi_read_timeout 600;
    }
}

nginx/nginx.conf

user nginx;
worker_processes 1;

daemon off;

events {
    worker_connections 1024;
}

error_log   /var/log/nginx/error.log warn;
pid         /var/run/nginx.pid;

http {
    include /etc/nginx/mime.types;
    default_type application/octet-stream;

    log_format main '$remote_addr - $remote_user [$time_local] "$request" '
    '$status $body_bytes_sent "$http_referer" '
    '"$http_user_agent" "$http_x_forwarded_for"';

    access_log /var/log/nginx/access.log main;

    sendfile on;

    keepalive_timeout 65;
    fastcgi_read_timeout 600;

    gzip on;

    include /etc/nginx/conf.d/*.conf;

}

Docker for mac beta not forwarding ports
(Jorilallo) #2

I’m experiencing the same issue, Docker for Mac is running but docker.local isn’t available and IPs on docker ps are labeled as None. Tried restarting the client as well, no help. On beta 8.


(Silas Ribas Martins) #3

I’m back to beta7 because beta8 f**k me with this problem.
:frowning:


(Philipp Bucher) #4

Same Problem

➜  ~ 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/20160421-113554.tar.gz
Most specific failure is: No error was detected
Your unique id is: 36954A97-82D6-4BDE-A62D-D00E2EAC29CA
Please quote this in all correspondence.

After starting a simple service with docker-compose:

➜  ~ docker ps
CONTAINER ID        IMAGE               COMMAND                CREATED             STATUS              PORTS               NAMES
0ec949f80436        navigate/php:5.6    "apache2-foreground"   15 seconds ago      Up 14 seconds       None:80->80/tcp     spkhd_app_1

docker-compose quits with:

ERROR: An HTTP request took too long to complete. Retry with --verbose to obtain debug information.
If you encounter this issue regularly because of slow network conditions, consider setting COMPOSE_HTTP_TIMEOUT to a higher value (current value: 60).

but Container running after the error.


(Armariya) #5

I’m facing this problem too! T^T


(Toby Cox) #6

Same thing’s happening to me too :frowning:


(Dave Scott) #7

Hi,

If the IP address shows up as “None” it means the VM failed to connect to the Apple “vmnet.framework”. There is currently a workaround: switch to exposing ports on localhost rather than docker.local:

pinata set native/port-forwarding true

This will reboot the VM, and then ports will be exposed on localhost on the Mac instead of docker.local e.g. “docker run -p 8080:80 nginx” will expose “nginx” on “http://localhost:8080/” instead of “http://docker.local:8080/

Let me know if this works for you (or not)

HTH,
Dave


VPN compatibiliy always enabled
Beta Docker.local not available after restart
(Silas Ribas Martins) #8

Hi,

I tried this but “None” continues to appear and yes, I can access using localhost. But, I’ve a problem: my mysql is running in OS X (host) and my app can’t connect to him using localhost or 127.0.0.1 or 192.168.64.1 (this IP points to my OSX, in beta7).

How to fix this?


(Jorilallo) #9

This worked for me - I thought I tried it before but I must have used the forwarded port etc. Is there a way to use forwarded ports with this approach?


(Vincentserpoul) #10

Same issue here.
The native port forwarding fixed the issue.


(Frenchben) #11

Instead of the port forwarding change, it’s usually easier to restart the entire laptop to clear any previous network cache


(Yoel Monzon) #12

Thanks for all, this worked for me, i had spent more than 2 hours with this issue :confused:


(Fuxi) #13

Workaround did not fully work for me. I experienced port clashes on 0.0.0.0
Need to revert to previous release :frowning:


(Jakob Løkke Madsen) #14

Port forwarding and a restart was necessary to make it work for me.


(Silas Ribas Martins) #15

Anyone know which is the IP that’s points to host (OSX), with pinata set native/port-forwarding true?


(Samuel Reed) #16

Can confirm - reverting to beta7 fixed this issue. To the Docker team, it would be great if beta7 were still available for download on the main page. I’m glad I had a copy of it.


(Tompson) #17

there is another thread about this problem: VPN compatibiliy always enabled

has something to do with VPN setting always enabled


(Silas Ribas Martins) #18

I’m still in the beta7. I need to access like beta7 and vpn always enabled with or without port forwarding break this.

Thk’s.


(billy clark) #19

How were you able to go back to beta7?


(billy clark) #20

I happened to have beta7 in my trash, so I was able to reinstall it. I’m guessing you must’ve done the same.