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

Add user and home in docker section #671

Closed
wants to merge 1 commit into from
Closed

Add user and home in docker section #671

wants to merge 1 commit into from

Conversation

floatdrop
Copy link

This will add user and home in docker part of .drone.yml.

@floatdrop
Copy link
Author

While docker run -t -i test-teamcity /bin/bash is working fine (I added USER teamcity in Dockerfile and build it), drone writing Not found (failed to completely delete build image . Not Found). I'm not quite sure, why is this happening.

@kzaitsev
Copy link

kzaitsev commented Nov 6, 2014

I think this is not good workaround, we can use docker inspect to get image configuration, and read User and WorkingDir

just for example

[{
    "Architecture": "amd64",
    "Author": "",
    "Comment": "",
    "Config": {
        "AttachStderr": false,
        "AttachStdin": false,
        "AttachStdout": false,
        "Cmd": [
            "/bin/bash"
        ],
        "CpuShares": 0,
        "Cpuset": "",
        "Domainname": "",
        "Entrypoint": null,
        "Env": [
            "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
            "rvmsudo_secure_path=1",
            "HOME=/home/ubuntu",
            "LANG=en_US.UTF-8",
            "LANGUAGE=en_US:en",
            "LOGNAME=ubuntu",
            "TERM=xterm"
        ],
        "ExposedPorts": null,
        "Hostname": "f22711318734",
        "Image": "90e913bc9d04cd6ee40db9c4f94eeea47680033ddbd8ed40939861ff63f5240d",
        "Memory": 0,
        "MemorySwap": 0,
        "NetworkDisabled": false,
        "OnBuild": [],
        "OpenStdin": false,
        "PortSpecs": null,
        "SecurityOpt": null,
        "StdinOnce": false,
        "Tty": false,
        "User": "ubuntu",
        "Volumes": null,
        "WorkingDir": "/home/ubuntu"
    },
    "Container": "ed86fd91c35188bb43bba375e0c3d4b94560f458b35e2314093aaaa172ee29f9",
    "ContainerConfig": {
        "AttachStderr": false,
        "AttachStdin": false,
        "AttachStdout": false,
        "Cmd": [
            "/bin/sh",
            "-c",
            "gpg --keyserver hkp:https://keys.gnupg.net --recv-keys D39DC0E3 \u0026\u0026\u0009/bin/bash -l -c \"rvmsudo rvm get stable\" \u0026\u0026    /bin/bash -l -c \"rvmsudo rvm install 2.1.4 --default\" \u0026\u0026    /bin/bash -l -c \"gem install bundler fpm --no-ri --no-rdoc\" \u0026\u0026    /bin/bash -l -c \"rvmsudo rvm cleanup all\""
        ],
        "CpuShares": 0,
        "Cpuset": "",
        "Domainname": "",
        "Entrypoint": null,
        "Env": [
            "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
            "rvmsudo_secure_path=1",
            "HOME=/home/ubuntu",
            "LANG=en_US.UTF-8",
            "LANGUAGE=en_US:en",
            "LOGNAME=ubuntu",
            "TERM=xterm"
        ],
        "ExposedPorts": null,
        "Hostname": "f22711318734",
        "Image": "90e913bc9d04cd6ee40db9c4f94eeea47680033ddbd8ed40939861ff63f5240d",
        "Memory": 0,
        "MemorySwap": 0,
        "NetworkDisabled": false,
        "OnBuild": [],
        "OpenStdin": false,
        "PortSpecs": null,
        "SecurityOpt": null,
        "StdinOnce": false,
        "Tty": false,
        "User": "ubuntu",
        "Volumes": null,
        "WorkingDir": "/home/ubuntu"
    },
    "Created": "2014-11-06T20:31:43.983269637Z",
    "DockerVersion": "1.3.0",
    "Id": "4e72be82a29e3812479afceab833e2be5b72683df5250bc19f7dcf719693cf8e",
    "Os": "linux",
    "Parent": "90e913bc9d04cd6ee40db9c4f94eeea47680033ddbd8ed40939861ff63f5240d",
    "Size": 223796122,
    "VirtualSize": 1676998967
}]

@floatdrop
Copy link
Author

Yes, this is much better!

@floatdrop floatdrop closed this Nov 7, 2014
@floatdrop floatdrop deleted the user-in-docker-section branch December 24, 2014 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants