├── LICENSE ├── README.md ├── chrome-headless ├── Dockerfile └── README.md ├── chrome ├── README.md ├── beta │ ├── Dockerfile │ └── local.conf └── unstable │ ├── Dockerfile │ └── local.conf ├── curl └── Dockerfile ├── dbeaver └── Dockerfile ├── dev-1404 ├── Dockerfile └── README.md ├── firefox-headless └── Dockerfile ├── kiiconf ├── Dockerfile └── README.md ├── lighthouse ├── Dockerfile └── README.md ├── polymer-cli ├── Dockerfile └── README.md ├── private-bower ├── Dockerfile ├── README.md ├── readonly_key └── start.sh ├── puppeteer-headless ├── Dockerfile ├── README.md └── example.js └── tftpd-hpa ├── Dockerfile └── README.md /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Justin Ribeiro 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # dockerfiles 2 | Various dockerfiles. 3 | -------------------------------------------------------------------------------- /chrome-headless/Dockerfile: -------------------------------------------------------------------------------- 1 | # Run Chrome Headless in a container 2 | # 3 | # What was once a container using the experimental build of headless_shell from 4 | # tip, this container now runs and exposes stable Chrome headless via 5 | # google-chome --headless. 6 | # 7 | # What's New 8 | # 9 | # 1. Pulls from Chrome Stable 10 | # 2. You can now use the ever-awesome Jessie Frazelle seccomp profile for Chrome. 11 | # wget https://raw.githubusercontent.com/jfrazelle/dotfiles/master/etc/docker/seccomp/chrome.json -O ~/chrome.json 12 | # 13 | # 14 | # To run (without seccomp): 15 | # docker run -d -p 9222:9222 --cap-add=SYS_ADMIN justinribeiro/chrome-headless 16 | # 17 | # To run a better way (with seccomp): 18 | # docker run -d -p 9222:9222 --security-opt seccomp=$HOME/chrome.json justinribeiro/chrome-headless 19 | # 20 | # Basic use: open Chrome, navigate to http://localhost:9222/ 21 | # 22 | 23 | # Base docker image 24 | FROM debian:buster-slim 25 | LABEL name="chrome-headless" \ 26 | maintainer="Justin Ribeiro " \ 27 | version="3.0" \ 28 | description="Google Chrome Headless in a container" 29 | 30 | # Install deps + add Chrome Stable + purge all the things 31 | RUN apt-get update && apt-get install -y \ 32 | apt-transport-https \ 33 | ca-certificates \ 34 | curl \ 35 | gnupg \ 36 | --no-install-recommends \ 37 | && curl -sSL https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \ 38 | && echo "deb https://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list \ 39 | && apt-get update && apt-get install -y \ 40 | google-chrome-stable \ 41 | fontconfig \ 42 | fonts-ipafont-gothic \ 43 | fonts-wqy-zenhei \ 44 | fonts-thai-tlwg \ 45 | fonts-kacst \ 46 | fonts-symbola \ 47 | fonts-noto \ 48 | fonts-freefont-ttf \ 49 | --no-install-recommends \ 50 | && apt-get purge --auto-remove -y curl gnupg \ 51 | && rm -rf /var/lib/apt/lists/* 52 | 53 | # Add Chrome as a user 54 | RUN groupadd -r chrome && useradd -r -g chrome -G audio,video chrome \ 55 | && mkdir -p /home/chrome && chown -R chrome:chrome /home/chrome 56 | 57 | # Run Chrome non-privileged 58 | USER chrome 59 | 60 | # Expose port 9222 61 | EXPOSE 9222 62 | 63 | # Autorun chrome headless with no GPU 64 | ENTRYPOINT [ "google-chrome" ] 65 | CMD [ "--headless", "--disable-gpu", "--remote-debugging-address=0.0.0.0", "--remote-debugging-port=9222" ] 66 | -------------------------------------------------------------------------------- /chrome-headless/README.md: -------------------------------------------------------------------------------- 1 | # Chrome Headless 2 | 3 | [![Docker Pulls](https://img.shields.io/docker/pulls/justinribeiro/chrome-headless.svg)](https://hub.docker.com/r/justinribeiro/chrome-headless/) 4 | 5 | What was once a container using the experimental build of headless_shell from tip, this container now runs and exposes stable Chrome headless via google-chome --headless. 6 | 7 | ## What's New 8 | 9 | 1. Pulls from Chrome Stable 10 | 2. You can now use the ever-awesome Jessie Frazelle seccomp profile for Chrome. 11 | `wget https://raw.githubusercontent.com/jfrazelle/dotfiles/master/etc/docker/seccomp/chrome.json -O ~/chrome.json` 12 | 13 | ## To run (without seccomp): 14 | `docker run -d -p 9222:9222 --cap-add=SYS_ADMIN justinribeiro/chrome-headless` 15 | 16 | ## To run a better way (with seccomp): 17 | `docker run -d -p 9222:9222 --security-opt seccomp=$HOME/chrome.json justinribeiro/chrome-headless` 18 | 19 | ## Using In DevTools 20 | Open Chrome and browse to `http://localhost:9222/`. 21 | 22 | ## Information on Chrome headless 23 | 24 | * [Getting Started with Chrome Headless](https://developers.google.com/web/updates/2017/04/headless-chrome) 25 | * [Chromium tracker](https://bugs.chromium.org/p/chromium/issues/list?q=label:Proj-Headless) 26 | * [Headless Chromium README](https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md) 27 | * [headless-dev mailing list](https://groups.google.com/a/chromium.org/forum/#!forum/headless-dev) 28 | 29 | ## General Use 30 | `docker run -d -p 9222:9222 justinribeiro/chrome-headless` 31 | 32 | ## Using In DevTools 33 | Open Chrome and browse to `http://localhost:9222/`. 34 | 35 | #Known issues 36 | 37 | ## Unsafe Scripts 38 | You may have to _Load unsafe scripts_ from the omnibox shield icon to allow connecting to the insecure websocket endpoint `ws://localhost:9222`: 39 | 40 | ![image](https://cloud.githubusercontent.com/assets/39191/21593324/b3e92618-d0ca-11e6-9472-d07b9b9df2c9.png) 41 | 42 | ## Red herrings 43 | Depending on the current build, if you run the container interactively you may see things like this on the console: 44 | ```sh 45 | [0501/162901.033074:WARNING:audio_manager.cc(295)] Multiple instances of AudioManager detected 46 | [0501/162901.033169:WARNING:audio_manager.cc(254)] Multiple instances of AudioManager detected 47 | ``` 48 | In most cases, these messages can be safely ignored. They will sometimes change and eventually as things are updated in the source tree, resolved. 49 | -------------------------------------------------------------------------------- /chrome/README.md: -------------------------------------------------------------------------------- 1 | ## Google Chrome with nvidia 361 driver support 2 | 3 | This setup is largely based on jfrazelle's work [https://github.com/jfrazelle/dockerfiles](https://github.com/jfrazelle/dockerfiles) but specific to the nightmare that is the nvidia driver. 4 | 5 | The way this works is that container nvidia driver has to match the host operating system (in my case, I'm running this on the 361 beta drivers). 6 | 7 | Your mileage will greatly vary. 8 | -------------------------------------------------------------------------------- /chrome/beta/Dockerfile: -------------------------------------------------------------------------------- 1 | # Base docker image 2 | FROM ubuntu:15.10 3 | MAINTAINER Justin Ribeiro 4 | 5 | # 6 | # Based on jfrazelle's: https://github.com/jfrazelle/dockerfiles/blob/master/chrome/beta/Dockerfile 7 | # 8 | # Changes are to run on my 15.04 + GTX 970 setup; your mileage will vary (fair warning) 9 | # 10 | # docker run -d \ 11 | # --memory 4gb 12 | # --net host 13 | # -v /etc/localtime:/etc/localtime:ro 14 | # -v="/tmp/.X11-unix:/tmp/.X11-unix:rw" 15 | # -e DISPLAY=unix$DISPLAY 16 | # -v $HOME/Downloads:/root/Downloads 17 | # -v $HOME/.chrome:/data 18 | # --device /dev/dri/card0 19 | # --device /dev/snd 20 | # --device /dev/video0 21 | # --device /dev/nvidia0 22 | # --device /dev/nvidiactl 23 | # justinribeiro/chrome:beta --user-data-dir=/data --force-device-scale-factor=1 24 | 25 | # pull chrome beta 26 | ADD https://dl.google.com/linux/direct/google-talkplugin_current_amd64.deb /src/google-talkplugin_current_amd64.deb 27 | ADD https://dl.google.com/linux/direct/google-chrome-beta_current_amd64.deb /src/google-chrome-beta_current_amd64.deb 28 | 29 | # Install Chrome Beta 30 | RUN mkdir -p /usr/share/icons/hicolor && \ 31 | apt-get update && apt-get install -y \ 32 | software-properties-common \ 33 | ca-certificates \ 34 | gconf-service \ 35 | hicolor-icon-theme \ 36 | libappindicator1 \ 37 | libasound2 \ 38 | libcanberra-gtk-module \ 39 | libcurl3 \ 40 | libexif-dev \ 41 | libgconf-2-4 \ 42 | libgl1-mesa-dri \ 43 | libgl1-mesa-glx \ 44 | libnspr4 \ 45 | libnss3 \ 46 | libpango1.0-0 \ 47 | libv4l-0 \ 48 | libxss1 \ 49 | libxtst6 \ 50 | wget \ 51 | xdg-utils \ 52 | --no-install-recommends && \ 53 | dpkg -i '/src/google-chrome-beta_current_amd64.deb' && \ 54 | dpkg -i '/src/google-talkplugin_current_amd64.deb' && \ 55 | rm -rf /var/lib/apt/lists/* 56 | 57 | # It's about to get ugly 58 | RUN add-apt-repository ppa:graphics-drivers/ppa 59 | RUN DEBIAN_FRONTEND=noninteractive apt-get update 60 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y nvidia-364 61 | 62 | COPY local.conf /etc/fonts/local.conf 63 | 64 | # Autorun chrome 65 | ENTRYPOINT [ "/usr/bin/google-chrome" ] 66 | CMD [ "--user-data-dir=/data" ] 67 | -------------------------------------------------------------------------------- /chrome/beta/local.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | rgb 7 | 8 | 9 | 10 | 11 | true 12 | 13 | 14 | 15 | 16 | hintslight 17 | 18 | 19 | 20 | 21 | true 22 | 23 | 24 | 25 | 26 | lcddefault 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /chrome/unstable/Dockerfile: -------------------------------------------------------------------------------- 1 | # Base docker image 2 | FROM ubuntu:15.10 3 | MAINTAINER Justin Ribeiro 4 | 5 | # 6 | # Based on jfrazelle's: https://github.com/jfrazelle/dockerfiles/blob/master/chrome/beta/Dockerfile 7 | # 8 | # Changes are to run on my 15.10 + GTX 970 setup; your mileage will vary (fair warning) 9 | # 10 | # docker run -d \ 11 | # --memory 4gb 12 | # --net host 13 | # -v /etc/localtime:/etc/localtime:ro 14 | # -v="/tmp/.X11-unix:/tmp/.X11-unix:rw" 15 | # -e DISPLAY=unix$DISPLAY 16 | # -v $HOME/Downloads:/root/Downloads 17 | # -v $HOME/.chrome:/data 18 | # --device /dev/dri/card0 19 | # --device /dev/snd 20 | # --device /dev/video0 21 | # --device /dev/nvidia0 22 | # --device /dev/nvidiactl 23 | # justinribeiro/chrome:unstable --user-data-dir=/data --force-device-scale-factor=1 24 | 25 | # pull chrome beta 26 | ADD https://dl.google.com/linux/direct/google-talkplugin_current_amd64.deb /src/google-talkplugin_current_amd64.deb 27 | ADD https://dl.google.com/linux/direct/google-chrome-unstable_current_amd64.deb /src/google-chrome-unstable_current_amd64.deb 28 | 29 | # Install Chrome Beta 30 | RUN mkdir -p /usr/share/icons/hicolor && \ 31 | apt-get update && apt-get install -y \ 32 | software-properties-common \ 33 | ca-certificates \ 34 | gconf-service \ 35 | hicolor-icon-theme \ 36 | libappindicator1 \ 37 | libasound2 \ 38 | libcanberra-gtk-module \ 39 | libcurl3 \ 40 | libexif-dev \ 41 | libgconf-2-4 \ 42 | libgl1-mesa-dri \ 43 | libgl1-mesa-glx \ 44 | libnspr4 \ 45 | libnss3 \ 46 | libpango1.0-0 \ 47 | libv4l-0 \ 48 | libxss1 \ 49 | libxtst6 \ 50 | wget \ 51 | xdg-utils \ 52 | fonts-liberation \ 53 | --no-install-recommends && \ 54 | dpkg -i '/src/google-chrome-unstable_current_amd64.deb' && \ 55 | dpkg -i '/src/google-talkplugin_current_amd64.deb' && \ 56 | rm -rf /var/lib/apt/lists/* 57 | 58 | # It's about to get ugly 59 | RUN add-apt-repository ppa:graphics-drivers/ppa 60 | RUN DEBIAN_FRONTEND=noninteractive apt-get update 61 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y nvidia-364 62 | 63 | COPY local.conf /etc/fonts/local.conf 64 | 65 | # Autorun chrome 66 | ENTRYPOINT [ "/usr/bin/google-chrome" ] 67 | CMD [ "--user-data-dir=/data" ] 68 | -------------------------------------------------------------------------------- /chrome/unstable/local.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | rgb 7 | 8 | 9 | 10 | 11 | true 12 | 13 | 14 | 15 | 16 | hintslight 17 | 18 | 19 | 20 | 21 | true 22 | 23 | 24 | 25 | 26 | lcddefault 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /curl/Dockerfile: -------------------------------------------------------------------------------- 1 | # Forked from 2 | # https://github.com/jessfraz/dockerfiles/blob/master/curl/Dockerfile 3 | # 4 | # Need a H2 client support version, disable a few more things 5 | 6 | FROM alpine:edge 7 | 8 | RUN apk add --no-cache \ 9 | ca-certificates \ 10 | nghttp2 \ 11 | openssl 12 | 13 | ENV CURL_VERSION 7.59.0 14 | 15 | RUN set -x \ 16 | && apk add --no-cache --virtual .build-deps \ 17 | g++ \ 18 | make \ 19 | nghttp2-dev \ 20 | openssl-dev \ 21 | perl \ 22 | && wget https://curl.haxx.se/download/curl-$CURL_VERSION.tar.bz2 \ 23 | && tar xjvf curl-$CURL_VERSION.tar.bz2 \ 24 | && rm curl-$CURL_VERSION.tar.bz2 \ 25 | && ( \ 26 | cd curl-$CURL_VERSION \ 27 | && ./configure \ 28 | --with-nghttp2=/usr \ 29 | --with-ssl \ 30 | --enable-ipv6 \ 31 | --enable-unix-sockets \ 32 | --without-libidn \ 33 | --disable-static \ 34 | --disable-ldap \ 35 | --disable-gopher \ 36 | --disable-telnet \ 37 | --disable-pop3 \ 38 | --disable-imap \ 39 | --with-pic \ 40 | && make \ 41 | && make install \ 42 | ) \ 43 | && rm -r curl-$CURL_VERSION \ 44 | && rm -r /usr/share/man \ 45 | && apk del .build-deps 46 | 47 | ENTRYPOINT ["/usr/local/bin/curl"] 48 | CMD ["-h"] -------------------------------------------------------------------------------- /dbeaver/Dockerfile: -------------------------------------------------------------------------------- 1 | # This is a little heavy handed, but works in a pinch when I need to handle DB 2 | # things 3 | # 4 | # docker run --name dbeaver \ 5 | # -v $HOME/.dbeaver4:/root/.dbeaver4 \ 6 | # -v $HOME/.dbeaver-drivers:/root/.dbeaver-drivers \ 7 | # -v /tmp/.X11-unix:/tmp/.X11-unix \ 8 | # -e DISPLAY=$DISPLAY \ 9 | # --net=host \ 10 | # --name dbeaver \ 11 | # justinribeiro/dbeaver 12 | # 13 | FROM java:openjdk-8-jre 14 | LABEL name="dbbeaver" \ 15 | maintainer="Justin Ribeiro " \ 16 | version="1.0" \ 17 | description="DBeaver database tooling in a container" 18 | 19 | ADD https://dbeaver.jkiss.org/files/dbeaver-ce_latest_amd64.deb . 20 | RUN apt-get update && apt-get install -y \ 21 | libswt-gtk-3-jni \ 22 | libswt-gtk-3-java \ 23 | --no-install-recommends \ 24 | && rm -rf /var/lib/apt/lists/* 25 | RUN dpkg -i dbeaver-ce_latest_amd64.deb 26 | 27 | CMD dbeaver 28 | -------------------------------------------------------------------------------- /dev-1404/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:14.04 2 | MAINTAINER Justin Ribeiro 3 | 4 | # 5 | # docker run -it \ 6 | # --privileged \ 7 | # -v /dev/bus/usb:/dev/bus/usb \ 8 | # --device=/dev/ttyUSB0 \ 9 | # -v ~/sourcecode:/opt/sourcecode \ 10 | # -n dev_1404 \ 11 | # justinribeiro/dev_1404 12 | # 13 | 14 | RUN apt-get update && apt-get install -y \ 15 | software-properties-common \ 16 | ca-certificates \ 17 | git-core \ 18 | gnupg \ 19 | flex \ 20 | bison \ 21 | gperf \ 22 | build-essential \ 23 | zip \ 24 | curl \ 25 | zlib1g-dev \ 26 | gcc-multilib \ 27 | g++-multilib \ 28 | libc6-dev-i386 \ 29 | bc \ 30 | python \ 31 | wget \ 32 | openjdk-7-jdk \ 33 | nano \ 34 | libxml2-utils 35 | 36 | # where the files exist 37 | VOLUME /opt/sourcecode 38 | 39 | CMD ["/bin/bash"] 40 | -------------------------------------------------------------------------------- /dev-1404/README.md: -------------------------------------------------------------------------------- 1 | # Dev Env built on Ubuntu 14.04 2 | 3 | Needed this for a project, Docker to the rescue. 4 | -------------------------------------------------------------------------------- /firefox-headless/Dockerfile: -------------------------------------------------------------------------------- 1 | # Run Firefox Headless in a container 2 | # 3 | # 4 | # To run (without seccomp): 5 | # docker run -d -p 6000:6000 --cap-add=SYS_ADMIN justinribeiro/firefox-headless 6 | # 7 | 8 | # Base docker image 9 | FROM debian:sid 10 | LABEL name="firefox-headless" \ 11 | maintainer="Justin Ribeiro " \ 12 | version="1.0" \ 13 | description="Firefox Headless in a container" 14 | 15 | # Install deps + add Chrome Stable + purge all the things 16 | RUN apt-get update && apt-get install -y \ 17 | apt-transport-https \ 18 | ca-certificates \ 19 | gnupg \ 20 | firefox \ 21 | --no-install-recommends \ 22 | && apt-get purge --auto-remove -y curl gnupg \ 23 | && rm -rf /var/lib/apt/lists/* 24 | 25 | RUN mkdir -p /etc/firefox/ 26 | RUN echo '\ 27 | lockPref("devtools.debugger.force-local", false);\n\ 28 | lockPref("devtools.debugger.remote-enabled", true);\n'\ 29 | >> /etc/firefox/syspref.js 30 | 31 | # Add firefox as a user 32 | RUN groupadd -r firefox && useradd -r -g firefox -G audio,video firefox \ 33 | && mkdir -p /home/firefox && chown -R firefox:firefox /home/firefox \ 34 | && mkdir -p /home/firefox/.mozilla \ 35 | && chown -R firefox:firefox /home/firefox/.mozilla 36 | 37 | # Run firefox non-privileged 38 | USER firefox 39 | 40 | # Expose port 6000 41 | EXPOSE 6000 42 | 43 | # Autorun chrome headless with no GPU 44 | ENTRYPOINT [ "firefox" ] 45 | CMD [ "--start-debugger-server","--headless"] 46 | -------------------------------------------------------------------------------- /kiiconf/Dockerfile: -------------------------------------------------------------------------------- 1 | # USE AT OWN RISK: I HAVE NOT HEAVILY TESTED THIS 2 | # Because I don't want to run the remote config tool, box it and run in...box. 3 | # docker run -it -p 9999:80 justinribeiro/kiiconf 4 | FROM ubuntu:bionic 5 | 6 | LABEL maintainer="justin@justinribeiro.com" \ 7 | version="0.1" \ 8 | description="Kiibohd KiiConf Web Configurator for Input Club Whitefox" 9 | 10 | # Because something wants tzdata, so we just punch this to the container so 11 | # the apt=get doesn't hang 12 | ENV TZ=Etc/UTC 13 | RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone 14 | 15 | # I pulled this from the kiibohd docker image for the controllers, see 16 | # https://github.com/kiibohd/controller/tree/master/Dockerfiles 17 | RUN apt-get update && \ 18 | apt-get install -qy locales 19 | 20 | RUN echo "LANG=en_US.UTF-8" > /etc/locale.conf 21 | RUN echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen 22 | ENV LANG en_US.UTF-8 23 | ENV LC_ALL en_US.UTF-8 24 | ENV LANGUAGE en_US:en 25 | RUN locale-gen 26 | 27 | # Install our packages (which I pulled from kiibohd dev docker file) and replace 28 | # Node with a more up-to=date version 29 | RUN apt-get update && apt-get install -y \ 30 | apt-transport-https \ 31 | ca-certificates \ 32 | curl \ 33 | gnupg \ 34 | --no-install-recommends \ 35 | && curl -sL https://deb.nodesource.com/setup_8.x | bash - \ 36 | && apt-get update && apt-get install -qy \ 37 | binutils-arm-none-eabi \ 38 | bsdmainutils \ 39 | cmake \ 40 | ctags \ 41 | dfu-util \ 42 | gcc-arm-none-eabi \ 43 | git \ 44 | libnewlib-arm-none-eabi \ 45 | libusb-1.0-0-dev \ 46 | lighttpd \ 47 | ninja-build \ 48 | nodejs \ 49 | php-cgi \ 50 | php-zip \ 51 | python3 \ 52 | python3-pil \ 53 | python3-pip \ 54 | && apt-get purge --auto-remove -y curl \ 55 | && rm -rf /var/lib/apt/lists/* 56 | 57 | WORKDIR /KiiConf 58 | 59 | # I had to fork the KiiConf so I could make a few changed to the base lighttpd 60 | # config and because I'll probably hack up some other pieces to this 61 | RUN cd /KiiConf \ 62 | && git clone https://github.com/justinribeiro/KiiConf.git . \ 63 | && mkdir -p /KiiConf/tmp && chmod 777 /KiiConf/tmp \ 64 | && npm install \ 65 | && tools/update_all.bash \ 66 | && npm run-script build \ 67 | && chown -R www-data:www-data /KiiConf 68 | 69 | # Since we're not running pip install against the reqs, just install some stuff 70 | # at the top level so we can get on with our day 71 | RUN pip3 install layout \ 72 | && pip3 install gitpython \ 73 | && pip3 install kll 74 | 75 | # This is pretty heavy handed, but it'll make it work in the container 76 | # 1. use sed to chop out the pipenv check since we're not going to use that in 77 | # the container (I should dig up a link to why this fails) 78 | # 2. the path gen for kll is wrong, so we replace the specific line numbers for 79 | # default and partial maps so that we can feed them from the tmp fs 80 | RUN sed -i.bak -e '34,44d' /KiiConf/controller/Keyboards/cmake.bash 81 | 82 | # Historical only; not required because of upstream patch 83 | # https://github.com/kiibohd/controller/commit/5dd72c2b5b36cd9c33e9d1061ece96a0b0c770ea 84 | # && sed -i.bak '163s|^.*$|set ( DefaultMap_Args ${DefaultMap_Args} ${PROJECT_BINARY_DIR}/${MAP}.kll )|' /KiiConf/controller/Lib/CMake/kll.cmake \ 85 | # && sed -i.bak '192s|^.*$|set ( PartialMap_Args ${PartialMap_Args} ${PROJECT_BINARY_DIR}/${MAP_PART}.kll )|' /KiiConf/controller/Lib/CMake/kll.cmake 86 | 87 | # This sets up the lighttpd server and the required PHP 88 | RUN mkdir -p /var/run/lighttpd && chown www-data:www-data /var/run/lighttpd \ 89 | && touch /var/run/lighttpd.pid && chown www-data:www-data /var/run/lighttpd.pid \ 90 | && cp /KiiConf/test_lighttpd.conf /etc/lighttpd/lighttpd.conf \ 91 | && lighttpd-enable-mod fastcgi-php 92 | 93 | # We only expose 80 because no cert gen at moment 94 | EXPOSE 80 95 | 96 | CMD /usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf 97 | -------------------------------------------------------------------------------- /kiiconf/README.md: -------------------------------------------------------------------------------- 1 | # Input Club KiiConf web configurator for Whitefox 2 | 3 | > EXPERIMENTAL! USE AT OWN RISK 4 | 5 | This is an experimetnal container that runs the KiiConf web interface to allow you configure and build various firmware for [Input Club keyboards](https://input.club/) (ala my current keyboard, a Whitefox). 6 | 7 | If you're just looking for the online configurator, see https://configurator.inputclub.com/. 8 | 9 | ## How to use 10 | 11 | ```sh 12 | $ docker build -t justinribeiro/kiiconf . 13 | $ docker run -it -p 9999:80 justinribeiro/kiiconf 14 | ``` 15 | 16 | Once the container is running, open the web interface at localhost:9999 and start making some keymaps! 17 | -------------------------------------------------------------------------------- /lighthouse/Dockerfile: -------------------------------------------------------------------------------- 1 | # Run Lighthouse w/ Chrome Headless in a container 2 | # 3 | # Lighthouse is a tool that allows auditing, performance metrics, and best 4 | # practices for Progressive Web Apps. 5 | # 6 | # What's New 7 | # 8 | # 1. Allows cache busting so you always get the latest lighthouse. 9 | # 1. Pulls from Chrome M59+ for headless support. 10 | # 2. You can now use the ever-awesome Jessie Frazelle seccomp profile for Chrome. 11 | # wget https://raw.githubusercontent.com/jfrazelle/dotfiles/master/etc/docker/seccomp/chrome.json -O ~/chrome.json 12 | # 13 | # 14 | # To run (without seccomp): 15 | # docker run -it ~/your-local-dir:/opt/reports --net host justinribeiro/lighthouse 16 | # 17 | # To run (with seccomp): 18 | # docker run -it ~/your-local-dir:/opt/reports --security-opt seccomp=$HOME/chrome.json --net host justinribeiro/lighthouse 19 | # 20 | 21 | FROM debian:buster-slim 22 | LABEL name="lighthouse" \ 23 | maintainer="Justin Ribeiro " \ 24 | version="3.0" \ 25 | description="Lighthouse analyzes web apps and web pages, collecting modern performance metrics and insights on developer best practices." 26 | 27 | # Install deps + add Chrome Stable + purge all the things 28 | RUN apt-get update && apt-get install -y \ 29 | apt-transport-https \ 30 | ca-certificates \ 31 | curl \ 32 | gnupg \ 33 | --no-install-recommends \ 34 | && curl -sSL https://deb.nodesource.com/setup_12.x | bash - \ 35 | && curl -sSL https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \ 36 | && echo "deb https://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list \ 37 | && apt-get update && apt-get install -y \ 38 | google-chrome-stable \ 39 | fontconfig \ 40 | fonts-ipafont-gothic \ 41 | fonts-wqy-zenhei \ 42 | fonts-thai-tlwg \ 43 | fonts-kacst \ 44 | fonts-symbola \ 45 | fonts-noto \ 46 | fonts-freefont-ttf \ 47 | nodejs \ 48 | --no-install-recommends \ 49 | && apt-get purge --auto-remove -y curl gnupg \ 50 | && rm -rf /var/lib/apt/lists/* 51 | 52 | ARG CACHEBUST=1 53 | RUN npm install -g lighthouse 54 | 55 | # Add Chrome as a user 56 | RUN groupadd -r chrome && useradd -r -g chrome -G audio,video chrome \ 57 | && mkdir -p /home/chrome/reports && chown -R chrome:chrome /home/chrome 58 | 59 | # some place we can mount and view lighthouse reports 60 | VOLUME /home/chrome/reports 61 | WORKDIR /home/chrome/reports 62 | 63 | # Run Chrome non-privileged 64 | USER chrome 65 | 66 | # Drop to cli 67 | CMD ["/bin/bash"] 68 | -------------------------------------------------------------------------------- /lighthouse/README.md: -------------------------------------------------------------------------------- 1 | # Lighthouse in a container 2 | 3 | [![Docker Pulls](https://img.shields.io/docker/pulls/justinribeiro/lighthouse.svg)](https://hub.docker.com/r/justinribeiro/lighthouse/) 4 | 5 | [Lighthouse](https://github.com/justinribeiro/dockerfiles/tree/master/lighthouse) analyzes web apps and web pages, collecting modern performance metrics and insights on developer best practices. This container allows you to use lighthouse in conjunction with the `--headless` option of Chrome M59+. 6 | 7 | ## How to Use 8 | 9 | ## Step 1: Run the container 10 | 11 | ``` 12 | docker run -itv ~/your-local-dir:/home/chrome/reports --cap-add=SYS_ADMIN justinribeiro/lighthouse 13 | ``` 14 | 15 | ## Step 1 Improved: A better way with SECCOMP 16 | 17 | Using the ever-awesome [Jessie Frazelle](https://twitter.com/jessfraz) SECCOMP profile for Chrome, we don't have to use the hammer that is SYS_ADMIN: 18 | 19 | ``` 20 | $ wget https://raw.githubusercontent.com/jfrazelle/dotfiles/master/etc/docker/seccomp/chrome.json -O ~/chrome.json 21 | $ docker run -itv ~/your-local-dir:/home/chrome/reports --security-opt seccomp=$HOME/chrome.json justinribeiro/lighthouse 22 | ``` 23 | 24 | ## Step 2: Run Lighthouse with `--chrome-flags` 25 | 26 | Once you're in the container, using the `--chrome-flags` option available in lighthouse, we can automatically start Chrome in headless mode within the container light so: 27 | 28 | ``` 29 | lighthouse --chrome-flags="--headless --disable-gpu" https://justinribeiro.com 30 | ``` 31 | 32 | ## I just want to run Chrome headless on 9222 within a container! 33 | 34 | Use my other [chrome-headless container](https://hub.docker.com/r/justinribeiro/chrome-headless/) for that. -------------------------------------------------------------------------------- /polymer-cli/Dockerfile: -------------------------------------------------------------------------------- 1 | # Run polymer-cli in a docker container 2 | # 3 | # Because the workstation build is failing and a container for this solves my 4 | # immediate problem. Yeah, that's how I roll sometimes. 5 | # 6 | # alias polymer='docker run --rm -it -p 8081:8081 -v $(pwd):/code 7 | # justinribeiro/polymer ' 8 | # 9 | FROM node:alpine 10 | LABEL name="polymer-cli" \ 11 | maintainer="Justin Ribeiro " \ 12 | version="1.0" \ 13 | description="polymer-cli in a container" 14 | 15 | RUN mkdir -p /code 16 | WORKDIR /code 17 | ADD . /code 18 | 19 | RUN apk add --no-cache git && \ 20 | npm install -g -s --no-progress bower polymer-cli --unsafe-perm && \ 21 | npm cache clean --force && \ 22 | npm uninstall -g npm 23 | 24 | EXPOSE 8081 25 | 26 | ENTRYPOINT ["polymer"] 27 | -------------------------------------------------------------------------------- /polymer-cli/README.md: -------------------------------------------------------------------------------- 1 | # Run polymer-cli in a docker container 2 | 3 | Because the workstation build is failing and a container for this solves my immediate problem. Yeah, that's how I roll sometimes. 4 | 5 | ``` 6 | alias polymer='docker run --rm -it -p 8081:8081 -v $(pwd):/code 7 | justinribeiro/polymer ' 8 | ``` -------------------------------------------------------------------------------- /private-bower/Dockerfile: -------------------------------------------------------------------------------- 1 | # Run private-bower in a really odd way, because I have a really really specific 2 | # situation where this makes sense. 3 | # 4 | # YOU SHOULD NOT RUN THIS IN PROD - LOCAL USE ONLY 5 | # SERIOUSLY DO NOT RUN OR PUBLISH IN THE OPEN 6 | # 7 | # docker run -it -v /work/sourcecode/acc-mirror:/mirror \ 8 | # -p 8081:8081 \ 9 | # -p 6789:6789 \ 10 | # -p 7891:7891 \ 11 | # justinribeiro/private-bower 12 | # 13 | FROM node:alpine 14 | LABEL name="private-bower" \ 15 | maintainer="Justin Ribeiro " \ 16 | version="1.0" \ 17 | description="prviate bower mirror in a container" 18 | 19 | RUN apk update && \ 20 | apk add --no-cache git openssh && \ 21 | npm install -g -s --no-progress private-bower --unsafe-perm && \ 22 | npm cache clean --force && \ 23 | npm uninstall -g npm 24 | 25 | WORKDIR /root 26 | 27 | # This is a really specific hack that you should not do in prod but that works 28 | # okay when in a bind on a local machine 29 | ADD ./readonly_key /root/.ssh/id_rsa 30 | ADD ./start.sh /root/start.sh 31 | 32 | RUN chmod 600 /root/.ssh/id_rsa 33 | RUN chmod +x /root/start.sh 34 | RUN touch /root/.ssh/known_hosts && \ 35 | ssh-keygen -R github.com 36 | 37 | # Not standard ports because ugh 38 | EXPOSE 6789 7891 8081 39 | VOLUME /mirror 40 | 41 | CMD [ "./start.sh" ] 42 | -------------------------------------------------------------------------------- /private-bower/README.md: -------------------------------------------------------------------------------- 1 | # private-bower 2 | 3 | Run private-bower in a really odd way, because I have a really really specific 4 | situation where this makes sense. 5 | 6 | > YOU SHOULD NOT RUN THIS IN PROD - LOCAL USE ONLY 7 | > SERIOUSLY DO NOT RUN OR PUBLISH IN THE OPEN 8 | 9 | Expects that you have a `readonly_key` private key to be able to import into the 10 | container when building (hence don't use this in prod). 11 | 12 | ## Steps 13 | 14 | 1. Make a `readonly_key` that you can use with ssh for git ops in the folder. 15 | 2. Build the container: 16 | ```sh 17 | docker build -t justinribeiro/private-bower . 18 | ``` 19 | 3. Run the container: 20 | ```sh 21 | docker run -it -v /work/sourcecode/acc-mirror:/mirror \ 22 | -p 8081:8081 \ 23 | -p 6789:6789 \ 24 | -p 7891:7891 \ 25 | justinribeiro/private-bower 26 | ``` -------------------------------------------------------------------------------- /private-bower/readonly_key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justinribeiro/dockerfiles/8e60d235551a04b2095d41509d88668850ebccfa/private-bower/readonly_key -------------------------------------------------------------------------------- /private-bower/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Need to start the ssh-agent so we can auth the session 4 | eval `ssh-agent -s` 5 | 6 | # add the key we copied to the session 7 | ssh-add 8 | 9 | # start the private-bower instance 10 | private-bower --config /mirror/bowerConfig.json -------------------------------------------------------------------------------- /puppeteer-headless/Dockerfile: -------------------------------------------------------------------------------- 1 | # Run Puppeteer Headless in a container 2 | # 3 | # What's New 4 | # 5 | # 1. Runs with Chrome Stable 6 | # 2. Uses the ever-awesome Jessie Frazelle seccomp profile for Chrome. 7 | # wget https://raw.githubusercontent.com/jfrazelle/dotfiles/master/etc/docker/seccomp/chrome.json -O ~/chrome.json 8 | # 3. Define `/output` to be used with `--mount` for easy file output 9 | # 10 | # To run with seccomp: 11 | # echo example.js | docker run -i --rm --security-opt seccomp=$HOME/chrome.json \ 12 | # --mount type=bind,source="$(pwd)"/output,target=/output \ 13 | # --name puppeteer-headless \ 14 | # justinribeiro/puppeteer-headless \ 15 | # node -e "`cat $_`" 16 | # 17 | FROM node:8-slim 18 | LABEL name="puppeteer-headless" \ 19 | maintainer="Justin Ribeiro " \ 20 | version="1.0" \ 21 | description="puppeteer in a container" 22 | 23 | RUN apt-get update && apt-get install -y \ 24 | apt-transport-https \ 25 | ca-certificates \ 26 | curl \ 27 | gnupg \ 28 | --no-install-recommends \ 29 | && curl -sSL https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \ 30 | && echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list \ 31 | && apt-get update \ 32 | && apt-get install -y \ 33 | google-chrome-stable \ 34 | fonts-ipafont-gothic \ 35 | fonts-wqy-zenhei \ 36 | fonts-thai-tlwg \ 37 | fonts-kacst \ 38 | ttf-freefont \ 39 | --no-install-recommends \ 40 | && rm -rf /var/lib/apt/lists/* \ 41 | && apt-get purge --auto-remove -y curl \ 42 | && rm -rf /src/*.deb 43 | 44 | ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true 45 | RUN npm i puppeteer 46 | 47 | RUN groupadd -r puppeteer && useradd -r -g puppeteer -G audio,video puppeteer \ 48 | && mkdir -p /home/puppeteer && chown -R puppeteer:puppeteer /home/puppeteer \ 49 | && chown -R puppeteer:puppeteer /node_modules \ 50 | && mkdir -p /output && chown -R puppeteer:puppeteer /output 51 | 52 | # Use via --mount for output 53 | VOLUME /output 54 | WORKDIR /output 55 | 56 | # Run everything non-privileged 57 | USER puppeteer 58 | 59 | CMD ["google-chrome-stable"] 60 | -------------------------------------------------------------------------------- /puppeteer-headless/README.md: -------------------------------------------------------------------------------- 1 | # Run Puppeteer Headless in a container 2 | 3 | ## What's New 4 | 5 | 1. Runs with Chrome Stable 6 | 2. Uses the ever-awesome Jessie Frazelle seccomp profile for Chrome. 7 | ```sh 8 | wget https://raw.githubusercontent.com/jfrazelle/dotfiles/master/etc/docker/seccomp/chrome.json -O ~/chrome.json 9 | ``` 10 | 3. Define `/output` to be used with `--mount` for easy file output 11 | 12 | ## To run with seccomp 13 | ```sh 14 | echo example.js | docker run -i --rm --security-opt seccomp=$HOME/chrome.json \ 15 | --mount type=bind,source="$(pwd)"/output,target=/output \ 16 | --name puppeteer-headless \ 17 | justinribeiro/puppeteer-headless \ 18 | node -e "`cat $_`" 19 | ``` 20 | -------------------------------------------------------------------------------- /puppeteer-headless/example.js: -------------------------------------------------------------------------------- 1 | // Sample script for testing docker container 2 | // Writes a screenshot file 3 | const puppeteer = require('puppeteer'); 4 | 5 | (async () => { 6 | const browser = await puppeteer.launch({ 7 | executablePath: 'google-chrome-stable' 8 | }); 9 | 10 | const page = await browser.newPage(); 11 | await page.goto('https://justinribeiro.com'); 12 | 13 | // /output should be bind mounted via --mount when running docker 14 | await page.screenshot({path: '/output/my-site-screenshot.png'}); 15 | await browser.close(); 16 | })(); -------------------------------------------------------------------------------- /tftpd-hpa/Dockerfile: -------------------------------------------------------------------------------- 1 | # Little overkill on the image don't ya think? 2 | FROM ubuntu:15.04 3 | MAINTAINER Justin Ribeiro 4 | 5 | # 6 | # Because sometimes hardware updates need some tftp 7 | # 8 | # docker run -d \ 9 | # --net host 10 | # -p 69:69 11 | # -v /my/tftp/files:/var/lib/tftpboot 12 | # --name tftp_server 13 | # justinribeiro/tftpd-hpa 14 | # 15 | 16 | RUN DEBIAN_FRONTEND=noninteractive apt-get update 17 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y tftpd-hpa 18 | 19 | # where the files exist 20 | VOLUME /var/lib/tftpboot 21 | 22 | # low number ports are fun 23 | EXPOSE 69 24 | 25 | # Start in foreground, be verbose, set address 26 | CMD /usr/sbin/in.tftpd -L -p -v -u tftp -a 0.0.0.0:69 -s /var/lib/tftpboot 27 | -------------------------------------------------------------------------------- /tftpd-hpa/README.md: -------------------------------------------------------------------------------- 1 | ## tftpd-hpa for all those devices 2 | 3 | Sometimes hardware needs that TFTP love in the lab. This resolves my issue, though with a big hammer (`--net host`). 4 | --------------------------------------------------------------------------------