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 desktop 3.5+: "network default: network.external.name is deprecated in favor of network.name" #3069

Closed
HeineDeelstra opened this issue Jun 25, 2021 · 5 comments

Comments

@HeineDeelstra
Copy link

Docker (Windows 10 Home/WSL2) just updated to 3.5.0 (66024). Projects on ddev 1.17.6 generate a warning "network default: network.external.name is deprecated in favor of network.name". Projects with varnish (ddev contrib) generate an error, "services.varnish.ports must be a list" and fail. Updating to Docker 3.5.1 did not solve or change the issue.

Currently unsure of the cause and working around it.

The start log:

14:55 $ ddev start
Starting XYZ...
Pushed mkcert rootca certs to ddev-global-cache/mkcert
Running   Command=ip address show dev docker0
time="2021-06-25T14:55:25+02:00" level=warning msg="network default: network.external.name is deprecated in favor of network.name"
services.varnish.ports must be a list
Failed to start XYZ: Failed to run docker-compose [-f /home/heine/sites/XYZ/.ddev/.ddev-docker-compose-base.yaml -f /home/heine/sites/XYZ/.ddev/docker-compose.environment.yaml -f /home/heine/sites/XYZ/.ddev/docker-compose.redis.yaml -f /home/heine/sites/XYZ/.ddev/docker-compose.solr.yaml -f /home/heine/sites/XYZ/.ddev/docker-compose.varnish.yaml config], err='exit status 15', stdout='', stderr='time="2021-06-25T14:55:25+02:00" level=warning msg="network default: network.external.name is deprecated in favor of network.name"
services.varnish.ports must be a list'

Our varnish compose:

14:55 $ cat .ddev/docker-compose.varnish.yaml
# DDev Varnish recipe file.
#
# To use this in your own project:
# 1. Copy this file to your project's ".ddev" directory.
# 2. Create the folder path ".ddev/varnish/".
# 3. Make a file with the following content at
#    ".ddev/varnish/default.vcl".
#
# vcl 4.0;
#
# backend default {
#   .host = "web:80";
# }
#
# Notes:
# - The configuration files must be present before running "ddev start".
# - Changes to the configuration files will not be automatically applied.
#
# To access the site through Varnish after it is installed simply visit the ddev
# site as usual. To avoid going through varnish visit the the novarnish. subdomain.

version: '3.6'

services:
  # This is the service name used when running ddev commands accepting the
  # --service flag.
  varnish:
    # This is the name of the container. It is recommended to follow the same
    # name convention used in the main docker-compose.yml file.
    container_name: ddev-${DDEV_SITENAME}-varnish
    image: "varnish:6.2"
    # These labels ensure this service is discoverable by ddev.
    labels:
      com.ddev.site-name: ${DDEV_SITENAME}
      com.ddev.approot: $DDEV_APPROOT
    environment:
      # This defines the host name the service should be accessible from. This
      # will be sitename.ddev.site.
      # This is the first half of the trick that puts varnish "in front of" the
      # web container, just by switching the names
      - VIRTUAL_HOST=$DDEV_HOSTNAME
      # This defines the ports the service should be accessible from at
      # sitename.ddev.site.
      - HTTPS_EXPOSE=443:80,8026:8025
      - HTTP_EXPOSE=80:80,8025:8025
      - SIZE=256M
    volumes:
      # This exposes a mount to the host system `.ddev/varnish` directory where
      # your default.vcl should be
      - ./varnish:/etc/varnish
      - ".:/mnt/ddev_config"
    ports: []
    links:
      - web:web
  # This is the second half of the trick that puts varnish "in front of" the web
  # container, just by switching the names
  web:
    environment:
      - VIRTUAL_HOST=novarnish.$DDEV_HOSTNAME
@rfay
Copy link
Member

rfay commented Jun 25, 2021

I'm pretty sure ports: [] is just an error and that line should be removed.

@rfay rfay changed the title Docker/WSL2 3.5.1 3.5.0 warning on network.external.name, varnish contrib no longer works. Docker 3.5+: "network default: network.external.name is deprecated in favor of network.name" Jun 25, 2021
@rfay
Copy link
Member

rfay commented Jun 25, 2021

Changed the title to focus this issue on the deprecation warning. The ports fix is just an error in the ddev-contrib varnish recipe and will be handled in ddev/ddev-contrib#144

@rfay rfay added this to the v1.18 milestone Jun 25, 2021
@rfay rfay changed the title Docker 3.5+: "network default: network.external.name is deprecated in favor of network.name" Docker desktop 3.5+: "network default: network.external.name is deprecated in favor of network.name" Jun 25, 2021
@bkbelton
Copy link

I started getting this warning with 1.17.6 and docker 3.5.1, but only on Apple M1, and get the nginx Bad Gateway error on launch. I have the same versions with the same repo on wsl and intel/mac and don't get either error.

@rfay
Copy link
Member

rfay commented Jun 28, 2021

If you turn off the Experimental settings you won't see it any more. Sadly, Docker decided that some of us should be canaries, with the setting turned on without our permission.

Settings

@rfay
Copy link
Member

rfay commented Jun 28, 2021

Opened upstream issue: docker-archive/compose-cli#1856

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

3 participants