Skip to content

Overlay networks can't be specified with network_mode and are not attachable #932

@kevenwyld

Description

@kevenwyld

Cookbook version

2.16.2

Chef-client version

12.21.10

Platform Details

NAME="Red Hat Enterprise Linux Server"
VERSION="7.4 (Maipo)"

platform vmware

Scenario:

Provisioning a network with mode attachable or configuring a container to connect to a custom network with the overlay driver.

Steps to Reproduce:

Attempt to provision an custom network and a container as follows:

docker_image 'alpine'

docker_network 'testnet' do
  driver 'overlay'
  internal true
  subnet '10.0.0.0/24'
  gateway '10.0.0.1'
  action :create
end

docker_container 'alpine01' do
  repo 'alpine'
  tag 'latest'
  ip_address '10.0.0.5'
  network_mode 'testnet'
  command 'top'
end

Expected Result:

The network testnet is created and a container called alpine01 is started connected to testnet with the ip 10.0.0.5.

Actual Result:

The container fails to start with the error:

"Could not attach to network testnet: rpc error: code = PermissionDenied desc = network testnet not manually attachable",

Additional notes:

I also attempted to create the network as attachable however the attachable parameter does not seem to be supported so all networks which are provisioned with the driver overlay are set "Attachable": false

Metadata

Metadata

Assignees

Labels

Feature RequestEnhancement to existing functionality or new functionality

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions