# Use the latest alpine ISO FROM alpine:latest # Copy the static xcookie file and add the start-firefox.sh script COPY xcookie /tmp/ ADD start-firefox.sh / RUN chmod +x /start-firefox.sh # Add the necessary packages # alsa-utils: for sound # xauth: to insert the host's X11 cookie on the container # firefox: our browser # ttf-liberation: so we have fonts in FX RUN apk add alsa-utils xauth firefox ttf-liberation # Create a user and group firefox. Add the user to groups firefox; audio; video. RUN adduser firefox -D ; addgroup firefox firefox ; addgroup firefox audio ; addgroup firefox video # Create the asoundrc on the newly created user and insert the X11 cookie RUN su -c 'echo -e "defaults.pcm.card 1;\ndefaults.pcm.device 0;\ndefaults.ctl.card 1;" > ~/.asoundrc' firefox RUN su -c "xauth add $(cat /tmp/xcookie)" firefox # Start the thingz CMD [ "/bin/sh", "/start-firefox.sh" ]