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

LogConfig does not work with other options set together #1136

Closed
pyang30 opened this issue Jul 21, 2016 · 1 comment
Closed

LogConfig does not work with other options set together #1136

pyang30 opened this issue Jul 21, 2016 · 1 comment

Comments

@pyang30
Copy link

pyang30 commented Jul 21, 2016

#!/usr/bin/env python
from docker import Client
import docker

def test_valid_log_driver_and_log_opt():

    client = Client("tcp://172.16.226.128:4243")
    log_config = docker.utils.LogConfig(
            type='json-file',
            config={'max-file': '100'}
            )

    container = client.create_container(
            "busybox", ['true'],
            host_config=client.create_host_config(log_config=log_config)
            )
    restart_policy = {"name": "always"}
#    client.start(container, restart_policy=restart_policy)
    client.start(container)
    info = client.inspect_container(container)
    container_log_config = info['HostConfig']['LogConfig']
    print container_log_config

if __name__ == "__main__":
    test_valid_log_driver_and_log_opt()

The above code comes form test/container_test.py, when I send the only one param "container" to client.start, the container's log config will be set correctly, but if I give two or more params to client.start, like restart_policy={xxx:xxx}, privileged=True or binds=xxx, or network_mode=xxx, the log config will not be set, it will use the default 'json-file'.

My test environment is:
docker-py == 1.6.0 docker 1.8

and docker-py=1.8 docker 1.11

@shin-
Copy link
Contributor

shin- commented Jul 25, 2016

Don't pass any config in Client.start, it is deprecated for good reason.

moby/moby#17799
#578

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants