Skip to content

Commit 441ab31

Browse files
committed
Modify devcontainer to give access to usb devices
1 parent 84ed9df commit 441ab31

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

.devcontainer/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM mcr.microsoft.com/devcontainers/base:alpine-3.18
2+
3+
RUN apk add --no-cache \
4+
libusb=1.0.26-r2 \
5+
py3-pip=23.1.2-r0

.devcontainer/devcontainer.json

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2-
// README at: https://github.com/devcontainers/templates/tree/main/src/python
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/alpine
33
{
4-
"name": "Python 3",
4+
"name": "Python Alpine",
55
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6-
"image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye",
6+
"build": {
7+
"dockerfile": "Dockerfile",
8+
"context": ".."
9+
},
710

811
// Features to add to the dev container. More info: https://containers.dev/features.
912
// "features": {},
@@ -14,9 +17,12 @@
1417
// Use 'postCreateCommand' to run commands after the container is created.
1518
"postCreateCommand": "pip3 install --user -r requirements.txt -r requirements_test.txt",
1619

20+
// Priviledged mode is necessary to get access to usb
21+
"runArgs": ["--privileged"]
22+
1723
// Configure tool-specific properties.
18-
"customizations": {}
24+
// "customizations": {},
1925

2026
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
21-
// "remoteUser": "root"
27+
//"remoteUser": "root"
2228
}

0 commit comments

Comments
 (0)