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

dockerbuild: stop container before committing it #8780

Merged
merged 1 commit into from
May 7, 2016

Conversation

csrwng
Copy link
Contributor

@csrwng csrwng commented May 6, 2016

The problem:
Images built with the new dockerbuild command get the wrong permisisons (0700 instead of 0755) in the /run/secrets (or /var/run/secrets) directory when running on non-RedHat docker hosts. This breaks loading secrets in containers created from those images.

The fix:
I found that this happens only when the container is committed while still running. If I the container is stopped before committing, the permissions for that directory come out right.

@csrwng
Copy link
Contributor Author

csrwng commented May 6, 2016

@smarterclayton ptal
cc @bparees

@@ -19,6 +19,9 @@ import (
"github.com/golang/glog"
)

// stopTimeoutSeconds is the timeout for stopping the running container
const stopTimeoutSeconds = 2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should have zero timeout - not sure why we would need it to be graceful.

@smarterclayton
Copy link
Contributor

Before this merges, be sure to fix the conformance_test to remove the "Red Hat secrets injection" workaround and verify it still runs.

@csrwng csrwng force-pushed the fix_dockerbuilder branch 2 times, most recently from 8e150bc to fa943f4 Compare May 6, 2016 21:03
@csrwng
Copy link
Contributor Author

csrwng commented May 6, 2016

fixed code and updated conformance test. However, the conformance test is failing for me, but I don't think it's due to this change:

--- FAIL: TestConformanceInternal (3.66s)
    conformance_test.go:431: a=map[.dockerignore:0xc2080afee0] b=map[] diff=map[]
    conformance_test.go:328: 0: full Docker build was not equivalent to squashed image metadata fixtures/ignore/Dockerfile

taking a closer look

@csrwng
Copy link
Contributor Author

csrwng commented May 6, 2016

I reverted to master and I still get the failure above so yes it doesn't look like it's related to this.

@smarterclayton
Copy link
Contributor

Internal conformance and external conformance have a mismatch right now. Can you comment out that test and run the other ones?

@csrwng
Copy link
Contributor Author

csrwng commented May 6, 2016

Commented out the test. Other tests pass.

@smarterclayton
Copy link
Contributor

Lgtm [merge]

@openshift-bot
Copy link
Contributor

openshift-bot commented May 7, 2016

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_origin/5844/) (Image: devenv-rhel7_4133)

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to 10980dc

@openshift-bot
Copy link
Contributor

[Test]ing while waiting on the merge queue

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to 10980dc

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/3660/)

@openshift-bot openshift-bot merged commit 0f581e3 into openshift:master May 7, 2016
@csrwng csrwng deleted the fix_dockerbuilder branch July 19, 2016 15:34
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.

3 participants