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

Binding to port 80 / 443 fails after upgrading to Docker Desktop 4.23.0 #17246

Closed
pre opened this issue Sep 14, 2023 · 1 comment
Closed

Binding to port 80 / 443 fails after upgrading to Docker Desktop 4.23.0 #17246

pre opened this issue Sep 14, 2023 · 1 comment

Comments

@pre
Copy link

pre commented Sep 14, 2023

What Happened?

Binding to port 80 and 443 fails after upgrading MacOS Docker Desktop to 4.23.0 (120376).

I'm using a docker network for getting a reliable static ip address for the local setup. (This was done before it was possible to define a static ip in Minikube).

However, everything worked until MacOS Docker Desktop 4.22.1.

Docker Desktop mentions in their changelog a related change:

Minikube fails with slice index out of range

template parsing error: template: :1:4: executing "" at <index (index .NetworkSettings.Ports "22/tcp") 0>: error calling index: reflect: slice index out of range

Reproduction script

  • Fails with Docker Desktop 4.23.0
  • Works with Docker Desktop 4.22.1

Creates a localhost alias 192.168.180.2 which allows connecting to localhost port 80 on the MacOS using an ip address which is different from the loopback 127.0.0.1 of the Minikube VM.

Minikube's port binding to this localhost alias fails with 4.23.0.

#!/usr/bin/env bash

set -Eeuo pipefail

sudo ifconfig lo0 alias 192.168.180.2

docker network create \
  --subnet "192.168.180.0/24" \
  --driver bridge \
  --gateway "192.168.180.1" \
  --scope local \
  --opt "--icc" \
  --opt "--ip-masq" \
  --opt "com.docker.network.driver.mtu=1500" \
  "bugreport" \
;

minikube start \
  --driver docker \
  --container-runtime=docker \
  --profile "bugreport" \
  --network "bugreport" \
  --ports "192.168.180.2:80:80,192.168.180.2:443:443" \
  --extra-config=apiserver.service-node-port-range=1-65535 \
;

echo "It worked?"
read

minikube delete -p bugreport
docker network remove bugreport

Which reduces to failing docker run

docker run -d -t --privileged --security-opt seccomp=unconfined --tmpfs /tmp --tmpfs /run -v /lib/modules:/lib/modules:ro --hostname bugreport --name bugreport --label created_by.minikube.sigs.k8s.io=true --label name.minikube.sigs.k8s.io=bugreport --label role.minikube.sigs.k8s.io= --label mode.minikube.sigs.k8s.io=bugreport --network bugreport --ip 192.168.180.2 --volume bugreport:/var --security-opt apparmor=unconfined --memory=16300mb --memory-swap=16300mb --cpus=2 -e container=docker --expose 8443 -p 192.168.180.2:80:80 -p 192.168.180.2:443:443 --publish=127.0.0.1::8443 --publish=127.0.0.1::22 --publish=127.0.0.1::2376 --publish=127.0.0.1::5000 --publish=127.0.0.1::32443 docker.io/kicbase/stable:v0.0.40@sha256:8cadf23777709e43eca447c47a45f5a4635615129267ce025193040ec92a1631
71c05f57b172a838c0a70e4971781bbacb87b261c3bce367a3307564120010be

docker: Error response from daemon: Ports are not available: exposing port TCP 192.168.180.2:443 -> 0.0.0.0:0: listen tcp 192.168.180.2:443: bind: permission denied.

Maybe it's a Docker Desktop issue after all 🤔

Attach the log file

bugreport.txt

Operating System

macOS (Default)

Driver

Docker

@pre
Copy link
Author

pre commented Oct 2, 2023

The issue is fixed in Docker Desktop v4.24.0

@pre pre closed this as completed Oct 2, 2023
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

1 participant