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

Container wont use static ip if start with docker-compose up without detached #11748

Closed
jose-pr opened this issue Sep 26, 2021 · 2 comments · Fixed by #11751
Closed

Container wont use static ip if start with docker-compose up without detached #11748

jose-pr opened this issue Sep 26, 2021 · 2 comments · Fixed by #11751
Assignees
Labels
In Progress This issue is actively being worked by the assignee, please do not work on this at this time. 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

@jose-pr
Copy link

jose-pr commented Sep 26, 2021

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

Steps to reproduce the issue:

version: "3.9"

networks:
  default:
    external: 
      name: podman
services:
  bitwarden:
    container_name: bitwarden
    image: vaultwarden/server:latest
    pull_policy: always
    cap_add:
      - NET_BIND_SERVICE
    sysctls:
      - net.ipv4.ip_unprivileged_port_start=0
    networks:
      default:
        ipv4_address: 10.88.0.89
  1. docker-compose up

Describe the results you received:
Container doesn't utilize the static ip. In this case it got the next one 10.88.0.90

Describe the results you expected:
The same behaviour that when you do: docker-compose up -d
In this case the ip gets set to 10.88.0.89

Additional information you deem important (e.g. issue happens only occasionally):

Output of podman version:

WARN[0000] Failed to decode the keys ["storage.options.override_kernel_check" "storage.options.thinpool.ostree_repo" "storage.options.thinpool.skip_mount_home"] from "/etc/containers/storage.conf". 
Version:      3.3.1
API Version:  3.3.1
Go Version:   go1.15.14
Built:        Mon Aug 30 16:46:46 2021
OS/Arch:      linux/amd64

Output of podman info --debug:

WARN[0000] Failed to decode the keys ["storage.options.override_kernel_check" "storage.options.thinpool.ostree_repo" "storage.options.thinpool.skip_mount_home"] from "/etc/containers/storage.conf". 
host:
  arch: amd64
  buildahVersion: 1.22.3
  cgroupControllers:
  - cpuset
  - cpu
  - io
  - memory
  - hugetlb
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.0.27-2.fc33.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.27, commit: '
  cpus: 4
  distribution:
    distribution: fedora
    version: "33"
  eventLogger: journald
  hostname: midgard-odin.yggdrasil.alacan.net
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 5.13.12-100.fc33.x86_64
  linkmode: dynamic
  memFree: 170901504
  memTotal: 16715124736
  ociRuntime:
    name: crun
    package: crun-1.0-1.fc33.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 1.0
      commit: 139dc6971e2f1d931af520188763e984d6cdfbf8
      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
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.1.12-2.fc33.x86_64
    version: |-
      slirp4netns version 1.1.12
      commit: 7a104a101aa3278a2152351a082a6df71f57c9a3
      libslirp: 4.3.1
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.5.0
  swapFree: 32378974208
  swapTotal: 34355539968
  uptime: 763h 58m 30.53s (Approximately 31.79 days)
registries:
  search:
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - docker.io
store:
  configFile: /etc/containers/storage.conf
  containerStore:
    number: 4
    paused: 0
    running: 2
    stopped: 2
  graphDriverName: overlay
  graphOptions:
    overlay.mountopt: nodev,metacopy=on
  graphRoot: /data/containers/storage
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "true"
  imageStore:
    number: 15
  runRoot: /var/run/containers/storage
  volumePath: /data/containers/storage/volumes
version:
  APIVersion: 3.3.1
  Built: 1630356406
  BuiltTime: Mon Aug 30 16:46:46 2021
  GitCommit: ""
  GoVersion: go1.15.14
  OsArch: linux/amd64
  Version: 3.3.1

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

podman-3.3.1-1.fc33.x86_64

Additional environment details (AWS, VirtualBox, physical, etc.):

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Sep 26, 2021
@Luap99
Copy link
Member

Luap99 commented Sep 27, 2021

I take a look.

@Luap99
Copy link
Member

Luap99 commented Sep 27, 2021

I think #11751 should fix this.

@Luap99 Luap99 added the In Progress This issue is actively being worked by the assignee, please do not work on this at this time. label Sep 27, 2021
Luap99 added a commit to Luap99/libpod that referenced this issue Sep 28, 2021
This matches what docker does. Also make sure the net aliases are also
shown when the container is stopped.

docker-compose uses this special alias entry to check if it is already
correctly connected to the network. [1]
Because we do not support static ips on network connect at the moment
calling disconnect && connect will loose the static ip.

Fixes containers#11748

[1] https://github.com/docker/compose/blob/0bea52b18dda3de8c28fcfb0c80cc08b8950645e/compose/service.py#L663-L667

Signed-off-by: Paul Holzinger <[email protected]>
@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
In Progress This issue is actively being worked by the assignee, please do not work on this at this time. 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

Successfully merging a pull request may close this issue.

2 participants