Closed NinjaSomething closed 2 years ago
I was able to determine that for some reason it's docker that isn't mounting docker.sock, or anything, into /var/run. The following docker command will create the instance but not map docker.sock as expected.
docker -H unix:///var/run/docker.sock run -d -p 22 -v /var/run/docker.sock:/var/run/docker.sock --name defaultubuntu1804-jcarlson-popos-puw67kv4 --privileged c230e559e99f /lib/systemd/systemd shell_opts: {}
I'm trying to determine if nothing will mount into /var/run because of how the docker image is built.
I'm going to close this because I solved the problem. Apparently docker won't let you map anything into /var/run when privileged is true. The following kitchen file worked with docker-in-docker:
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
# For help on this file's format, see https://kitchen.ci/
driver:
name: docker
use_sudo: false
username: root
volume:
- /var/run/docker.sock:/run/docker.sock
transport:
name: docker
platforms:
- name: ubuntu-18.04
driver_config:
run_command: /lib/systemd/systemd
suites:
- name: default
provisioner:
name: salt_solo
salt_install: none
require_chef: false
salt_copy_filter:
- .kitchen
- .git
run_salt_call: false
verifier:
name: shell
remote_exec: false
command: python3 -m pytest -s -v test/
reporter:
- cli
:ghost: Brief Description
I am unable to map /var/run/docker.sock into the docker instance as a volume. I'm trying to do docker-in-docker.
Version
2.11.0
Environment
Pop!_OS 20.04 LTS
Scenario
I'm trying to run docker-in-docker. To do this I'm mapping /var/run/docker.sock into the kitchen-docker instance.
Steps to Reproduce
kitchen.yml
Create docker instance:
Check to see if docker.sock was mapped into the docker instance:
Inspect the docker instance:
Expected Result
I would expect to see docker.sock in /var/run when I log into the docker instance.
Actual Result
I do not see docker.sock in /var/run when I log into the docker instance.