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

Update dind setup for tests #8081

Merged
merged 1 commit into from
Feb 17, 2021
Merged

Conversation

aiordache
Copy link
Contributor

Update Jenkins files and scripts:

  • mount .docker/config for authenticating pulls in dind containers
  • replace image dockerswarm/dind with docker:<version>-dind

Jenkinsfile Outdated
@@ -99,6 +99,8 @@ def runTests(dockerVersion, pythonVersion, baseImage) {
--privileged \\
--volume="\$(pwd)/.git:/code/.git" \\
--volume="/var/run/docker.sock:/var/run/docker.sock" \\
--volume="\$(pwd)/.docker/config.json:/code/.docker/config.json" \\
Copy link
Member

Choose a reason for hiding this comment

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

I think it needs to be in the home directory, so I assume it is /root/.docker/config.json in the container. On the host probably in $HOME.

Copy link
Member

Choose a reason for hiding this comment

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

Looks like script/test/all uses ~/.docker/ ..., which should also work

Copy link
Member

Choose a reason for hiding this comment

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

(for the "host" side that is 😅)

script/test/all Outdated Show resolved Hide resolved
script/test/all Outdated Show resolved Hide resolved
@@ -99,6 +99,8 @@ def runTests(dockerVersion, pythonVersion, baseImage) {
--privileged \\
Copy link
Member

Choose a reason for hiding this comment

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

Do we actually need --privileged for this container? I see it bind-mounts docker.sock, which means that all docker commands will actually run against the docker daemon running on the host (not a dockerd daemon running inside the container (which would require privileged)

Copy link
Member

Choose a reason for hiding this comment

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

Actually wondering if we need a container here at all, because it's running a container, just to run a script, that uses the docker CLI inside the container to start new containers on the host 🤔

Copy link
Member

@StefanScherer StefanScherer left a comment

Choose a reason for hiding this comment

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

LGTM
Wonder if it this works, I saw a dockerbuildbot/compose image 😅
Maybe we should rerun CI?

Signed-off-by: aiordache <anca.iordache@docker.com>
@ulyssessouza ulyssessouza merged commit 3297bb5 into docker:master Feb 17, 2021
@thaJeztah
Copy link
Member

Also opened docker-library/docker#295 for discussion

If I find some time, I may have a look at #8081 (comment)

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.

4 participants