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

Services IPv4 address config ignored when using docker-compose networks #10585

Closed
w4tsn opened this issue Jun 7, 2021 · 4 comments
Closed

Services IPv4 address config ignored when using docker-compose networks #10585

w4tsn opened this issue Jun 7, 2021 · 4 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@w4tsn
Copy link
Contributor

w4tsn commented Jun 7, 2021

/kind bug

Description

When specifying a docker-compose services network address, the address is ignored.

Steps to reproduce the issue:

Create a compose file with a simple /24 network and a service with a static ipv4_address setting in that network.

The following will keep the alpine container running for 5 sec. Start this multiple times, even with docker-compose down before docker-compose up -d again.

version: '2'
services:
  alpine:
    image: "docker.io/library/alpine"
    command: "sleep 5000"
    networks:
      test:
        ipv4_address: 10.89.98.2

networks:
  test:
    ipam:
      driver: default
      config:
        - subnet: 10.89.98.0/24
          gateway: 10.89.98.1

Describe the results you received:

The container created for the service receives the next free address that was never assigned before in that network, although the network is freshly created. The specified address for this service is ignored.

Describe the results you expected:

The container receives the specified address in the network.

Output of podman version:

Version:      3.1.2
API Version:  3.1.2
Go Version:   go1.16.3
Built:        Wed May 12 21:27:59 2021
OS/Arch:      linux/amd64

Output of podman info --debug:

host:
  arch: amd64
  buildahVersion: 1.20.1
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.0.27-2.fc34.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.27, commit: '
  cpus: 4
  distribution:
    distribution: fedora
    version: "34"
  eventLogger: journald
  hostname: backend05.othermo.de
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 5.12.8-300.fc34.x86_64
  linkmode: dynamic
  memFree: 13585588224
  memTotal: 16779862016
  ociRuntime:
    name: crun
    package: crun-0.19.1-3.fc34.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 0.19.1
      commit: 1535fedf0b83fb898d449f9680000f729ba719f5
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
  os: linux
  remoteSocket:
    exists: true
    path: /run/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: false
    seccompEnabled: true
    selinuxEnabled: true
  slirp4netns:
    executable: ""
    package: ""
    version: ""
  swapFree: 8589930496
  swapTotal: 8589930496
  uptime: 66h 51m 13.15s (Approximately 2.75 days)
registries:
  search:
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - docker.io
  - quay.io
store:
  configFile: /etc/containers/storage.conf
  containerStore:
    number: 4
    paused: 0
    running: 4
    stopped: 0
  graphDriverName: overlay
  graphOptions:
    overlay.mountopt: nodev,metacopy=on
  graphRoot: /var/lib/containers/storage
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "true"
  imageStore:
    number: 5
  runRoot: /run/containers/storage
  volumePath: /var/lib/containers/storage/volumes
version:
  APIVersion: 3.1.2
  Built: 1620847679
  BuiltTime: Wed May 12 21:27:59 2021
  GitCommit: ""
  GoVersion: go1.16.3
  OsArch: linux/amd64
  Version: 3.1.2

Package info (e.g. output of rpm -q podman or apt list podman):

podman-3.1.2-3.fc34.x86_64
@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Jun 7, 2021
@w4tsn w4tsn changed the title IPv4 address config ignored when using docker-compose networks Services IPv4 address config ignored when using docker-compose networks Jun 7, 2021
@mheon
Copy link
Member

mheon commented Jun 7, 2021

I think we've patched this already, please try Podman 3.2.0 and see if it resolves the issue.

@rhatdan
Copy link
Member

rhatdan commented Jun 7, 2021

Reopen if we are mistaken.

@rhatdan rhatdan closed this as completed Jun 7, 2021
@w4tsn
Copy link
Contributor Author

w4tsn commented Jun 8, 2021

Amazing! Working with 3.2.0-rc3

@zhangguanzhang
Copy link
Collaborator

Fixes by #10246

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

No branches or pull requests

4 participants