Skip to content

Instantly share code, notes, and snippets.

@ndunks
Created February 25, 2023 06:08
Show Gist options
  • Save ndunks/4682237e43d9252e6726c4d07e681f91 to your computer and use it in GitHub Desktop.
Save ndunks/4682237e43d9252e6726c4d07e681f91 to your computer and use it in GitHub Desktop.

Revisions

  1. ndunks created this gist Feb 25, 2023.
    22 changes: 22 additions & 0 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    FROM ubuntu:16.04



    RUN apt-get update && apt-get install -y chromium-browser
    RUN export uid=1000 gid=1000 && \
    mkdir -p /home/user && \
    echo "user:x:${uid}:${gid}:User,,,:/home/user:/bin/bash" >> /etc/passwd && \
    echo "user:x:${uid}:" >> /etc/group && \
    echo "user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
    chown "${uid}:${gid}" -R /home/user

    # chmod 0440 /etc/sudoers.d/user && \

    RUN apt install xauth
    USER user
    ENV HOME /home/user
    CMD '/bin/bash'
    #CMD ['chromium-browser', '--no-sandbox']

    # docker build -t chromium .
    # docker run --net=host --name chrome -it --rm -e DISPLAY=$DISPLAY -e XAUTHORITY=$XAUTHORITY -v $XDG_RUNTIME_DIR:$XDG_RUNTIME_DIR chromium