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: "host" network_mode is incompatible with port_bindings #53

Closed
jmarhee opened this issue Feb 8, 2021 · 2 comments · Fixed by #56
Closed

Docker Compose: "host" network_mode is incompatible with port_bindings #53

jmarhee opened this issue Feb 8, 2021 · 2 comments · Fixed by #56
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/duplicate Indicates an issue is a duplicate of other open issue.

Comments

@jmarhee
Copy link
Contributor

jmarhee commented Feb 8, 2021

The following lines are in conflict:
https://github.com/tinkerbell/sandbox/blob/58937939c36239e9fb3fb03b5e744f7d0249a9c4/deploy/docker-compose.yml#L117

and

https://github.com/tinkerbell/sandbox/blob/58937939c36239e9fb3fb03b5e744f7d0249a9c4/deploy/docker-compose.yml#L144-L147

Resulting in:

root@tinkerbell:~/sandbox-master/deploy# source ../.env; docker-compose up -d
Building with native build. Learn about native build in Compose here: https://docs.docker.com/go/compose-native-build/
deploy_db_1 is up-to-date
Recreating deploy_nginx_1 ...
deploy_registry_1 is up-to-date
Recreating 17fbb5905e81_deploy_boots_1 ...
deploy_hegel_1 is up-to-date
Recreating deploy_nginx_1                 ... done
ERROR: for 17fbb5905e81_deploy_boots_1  "host" network_mode is incompatible with port_bindings
Recreating deploy_tink-server-migration_1 ... done
Recreating deploy_tink-server_1           ... done
deploy_tink-cli_1 is up-to-date

ERROR: for boots  "host" network_mode is incompatible with port_bindings
Traceback (most recent call last):
  File "docker-compose", line 3, in <module>
  File "compose/cli/main.py", line 80, in main
  File "compose/cli/main.py", line 192, in perform_command
  File "compose/metrics/decorator.py", line 18, in wrapper
  File "compose/cli/main.py", line 1165, in up
  File "compose/cli/main.py", line 1161, in up
  File "compose/project.py", line 708, in up
  File "compose/parallel.py", line 106, in parallel_execute
  File "compose/parallel.py", line 204, in producer
  File "compose/project.py", line 694, in do
  File "compose/service.py", line 580, in execute_convergence_plan
  File "compose/service.py", line 502, in _execute_convergence_recreate
  File "compose/parallel.py", line 106, in parallel_execute
  File "compose/parallel.py", line 204, in producer
  File "compose/service.py", line 495, in recreate
  File "compose/service.py", line 614, in recreate_container
  File "compose/service.py", line 333, in create_container
  File "compose/service.py", line 937, in _get_container_create_options
  File "compose/service.py", line 1069, in _get_container_host_config
  File "docker/api/container.py", line 598, in create_host_config
  File "docker/types/containers.py", line 339, in __init__
docker.errors.InvalidArgument: "host" network_mode is incompatible with port_bindings
[512463] Failed to execute script docker-compose

From my reading of this container configuration, it seems like the network_mode: host line would be preferable to be removed. It seems to work either way (I tried this using both configurations and was able to complete a provisioning), but not totally sure what the prefered resolution might be if there are implications to either that I'm not considering. Thanks!

@gianarb
Copy link
Contributor

gianarb commented Feb 9, 2021

Hello!! Thank you for reporting this. It is a duplicate of #53

if you want to help with that, please raise a PR!! we need a fix for that!

@gianarb gianarb closed this as completed Feb 9, 2021
@gianarb gianarb added kind/bug Categorizes issue or PR as related to a bug. triage/duplicate Indicates an issue is a duplicate of other open issue. labels Feb 9, 2021
jmarhee added a commit to jmarhee/sandbox that referenced this issue Feb 17, 2021
jmarhee added a commit to jmarhee/sandbox that referenced this issue Feb 17, 2021
…for boots container definition

Signed-off-by: Joseph D. Marhee <[email protected]>
mergify bot added a commit that referenced this issue Feb 18, 2021
#56)

… container definition

## Description

Resolves #53 

## Why is this needed

This conflict causes container creation to fail. 

Fixes: #

## How Has This Been Tested?

I ran the setup and was able to run a workflow and deployment without issue.

## How are existing users impacted? What migration steps/scripts do we need?

No impact.


## Checklist:

I have:

- [ ] updated the documentation and/or roadmap (if required)
- [ ] added unit or e2e tests
- [ ] provided instructions on how to upgrade
@MeghnaW19
Copy link

What is the solution to this error? I'm also facing the same issue!

ttwd80 pushed a commit to ttwd80/tinkerbell-playground that referenced this issue Sep 7, 2024
…for boots container definition

Signed-off-by: Joseph D. Marhee <[email protected]>
ttwd80 pushed a commit to ttwd80/tinkerbell-playground that referenced this issue Sep 7, 2024
…for boots… (tinkerbell#56)

… container definition

## Description

Resolves tinkerbell#53 

## Why is this needed

This conflict causes container creation to fail. 

Fixes: #

## How Has This Been Tested?

I ran the setup and was able to run a workflow and deployment without issue.

## How are existing users impacted? What migration steps/scripts do we need?

No impact.


## Checklist:

I have:

- [ ] updated the documentation and/or roadmap (if required)
- [ ] added unit or e2e tests
- [ ] provided instructions on how to upgrade
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/duplicate Indicates an issue is a duplicate of other open issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants