Skip to content

Added Docker and Vagrant support#32

Open
Manouchehri wants to merge 2 commits into
Lekensteyn:masterfrom
Manouchehri:docker-and-vagrant
Open

Added Docker and Vagrant support#32
Manouchehri wants to merge 2 commits into
Lekensteyn:masterfrom
Manouchehri:docker-and-vagrant

Conversation

@Manouchehri

Copy link
Copy Markdown

Example usage:

mbp:lglaf dave$ vagrant up
Bringing machine 'default' up with 'vmware_fusion' provider...
==> default: Cloning VMware VM: 'bento/ubuntu-16.04'. This can take some time...
==> default: Checking if box 'bento/ubuntu-16.04' is up to date...
==> default: Verifying vmnet devices are healthy...
==> default: Preparing network adapters...
==> default: Starting the VMware VM...
==> default: Waiting for the VM to receive an address...
==> default: Waiting for machine to boot. This may take a few minutes...
==> default: Machine booted and ready!
==> default: Configuring network adapters within the VM...
==> default: Waiting for HGFS to become available...
==> default: Enabling and configuring shared folders...
    default: -- /Users/dave/lglaf: /vagrant
==> default: Running provisioner: docker...
    default: Installing Docker onto machine...
==> default: Starting Docker containers...
==> default: -- Container: thawsystems/lglaf
mbp:lglaf dave$ vagrant ssh
vagrant@vagrant:~$ docker attach lglaf
vagrant@vagrant:~$ docker attach lglaf
root@14d9056e4d77:~# lglaf.py
No handlers could be found for logger "LGLAF.py"
LGLAF.py by Peter Wu (https://lekensteyn.nl/lglaf)
Type a shell command to execute or "exit" to leave.
# whoami
root
# id
uid=0(root) gid=0(root) groups=0(root) context=u:r:kernel:s0

Comment thread Dockerfile
pip install pyusb && \
su - lglaf -c "git clone https://github.com/Lekensteyn/lglaf.git" && \
cp -v ~/lglaf/rules.d/42-usb-lglaf.rules /etc/udev/rules.d/ && \
udevadm control --reload-rules || true && \

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

this || true looks wrong.

Since you have an isolated container anyway, you could also consider a chgrp lglaf /dev/usb/*/* I guess.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

That's just so Dockerhub doesn't bail out on building.

Won't that break hotplugging?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I hoped that inotify works also in Docker containers, then you do not need any udevadm command. If you can do hotplugging, try checking for events with udevadm monitor while your container has started.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

udevadm monitor sees the kernel plug events, but doesn't apply udev rules. udev seems to refuse since it detects that it's a container.

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.

2 participants