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-compose cannot set static ip when use ipam #10245

Closed
zhangguanzhang opened this issue May 6, 2021 · 0 comments · Fixed by #10246
Closed

docker-compose cannot set static ip when use ipam #10245

zhangguanzhang opened this issue May 6, 2021 · 0 comments · Fixed by #10246
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@zhangguanzhang
Copy link
Collaborator

compose file content:

version: "3.2"
services:
  emby:
    image: docker.io/library/alpine:latest
    networks:
      test:
        ipv4_address: 10.1.0.253
    tty: true
    command: ["top"]

networks:
  test:
    driver: bridge
    ipam:
      driver: default
      config:
        - subnet: 10.1.0.0/24

use docker:

$ docker-compose up -d
Creating network "root_test" with driver "bridge"
Creating root_emby_1 ... done
$ docker inspect root_emby_1 --format '{{ .NetworkSettings.Networks.root_test.IPAddress }}'
10.1.0.253

use the latest code to compile, podman:

$ ./bin/podman  system service -t 0 unix:///var/run/docker.sock --log-level debug
# in windows 2
$ docker-compose up -d
$ podman inspect root_emby_1 --format '{{ .NetworkSettings.Networks.root_test.IPAddress }}'
10.1.0.2  <--------- should be 10.1.0.253
@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 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
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.

1 participant