Skip to content

Instantly share code, notes, and snippets.

@danielroedl
Last active October 18, 2022 15:27
Show Gist options
  • Select an option

  • Save danielroedl/247cc24d932c0982aee9e9e9ddd266cf to your computer and use it in GitHub Desktop.

Select an option

Save danielroedl/247cc24d932c0982aee9e9e9ddd266cf to your computer and use it in GitHub Desktop.

Revisions

  1. danielroedl revised this gist Oct 18, 2022. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions run.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    #!/bin/bash
    docker build . --tag my-ubuntu
    docker build . --tag ubuntu:22.04-shared-display-and-audio
    docker run -it --rm \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -e DISPLAY=$DISPLAY \
    @@ -11,5 +11,5 @@ docker run -it --rm \
    -u $(id -u):$(id -g) \
    -v $PWD:$PWD \
    -w $PWD \
    my-ubuntu
    ubuntu:22.04-shared-display-and-audio

  2. danielroedl created this gist Oct 18, 2022.
    11 changes: 11 additions & 0 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    FROM ubuntu:22.04

    RUN apt-get update -y \
    # needed for sound
    libpulse0 libasound2 libasound2-plugins \
    # to test sound with e. g. aplay <sound-file>
    alsa-base \
    # to test display with xterm
    xterm \
    && \
    rm -rf /var/lib/apt/lists/*
    15 changes: 15 additions & 0 deletions run.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    #!/bin/bash
    docker build . --tag my-ubuntu
    docker run -it --rm \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -e DISPLAY=$DISPLAY \
    -v /etc/alsa:/etc/alsa \
    -v /usr/share/alsa:/usr/share/alsa \
    -v $HOME/.config/pulse:/.config/pulse \
    -v /run/user/$UID/pulse/native:/run/user/$UID/pulse/native \
    -e PULSE_SERVER=unix:/run/user/$UID/pulse/native \
    -u $(id -u):$(id -g) \
    -v $PWD:$PWD \
    -w $PWD \
    my-ubuntu