Skip to content

Instantly share code, notes, and snippets.

@wking
wking / notes.md
Created September 11, 2018 23:57
Binding a device into a container via a shared directory

That doesn't seem like a critical issue, just adjust the paths in my example to match whatever you need.

I think it is, unless /dev in the container is a bind-mount with shared propagation, how can I make /dev/nvidia appear inside the container without a subdirectory?

# mkdir /tmp/scratch
# podman run -it --rm --volume /tmp/scratch/:/tmp/scratch:shared docker.io/library/busybox
/ # ls -l /dev/
total 0
crw--w----    1 root     tty       136,   0 Sep 11 23:46 console
@wking
wking / PR-1065-2a1bf261f7.console
Created January 17, 2019 06:20
IPNet (de)serialization comparison
$ go run test.go
serialize JSON
their JSON: {"IP":"192.168.0.10","Mask":"////AA=="}
our JSON: "192.168.0.10/24"
serialize String
their String: 192.168.0.10/24
our String: 192.168.0.10/24
deserialize JSON