From 6e563ac528188d6c9cd823859493f0463024459b Mon Sep 17 00:00:00 2001 From: Jess Frazelle Date: Tue, 5 Apr 2016 10:12:37 -0700 Subject: [PATCH] update chrome and mutt Signed-off-by: Jess Frazelle --- chrome/beta/Dockerfile | 54 ++++++++++++++++++++-------------------- chrome/stable/Dockerfile | 34 +++++++------------------ mutt/.mutt/muttrc | 2 +- mutt/Dockerfile | 23 ++++++++--------- mutt/entrypoint.sh | 23 ++++++++++------- 5 files changed, 62 insertions(+), 74 deletions(-) diff --git a/chrome/beta/Dockerfile b/chrome/beta/Dockerfile index 30b5a85..6fe73db 100644 --- a/chrome/beta/Dockerfile +++ b/chrome/beta/Dockerfile @@ -1,49 +1,49 @@ +# Run Chrome in a container +# +# docker run -it \ +# --net host \ # may as well YOLO +# --cpuset-cpus 0 \ # control the cpu +# --memory 512mb \ # max memory it can use +# -v /tmp/.X11-unix:/tmp/.X11-unix \ # mount the X11 socket +# -e DISPLAY=unix$DISPLAY \ +# -v $HOME/Downloads:/root/Downloads \ +# -v $HOME/.config/google-chrome/:/data \ # if you want to save state +# --device /dev/snd \ # so we have sound +# -v /dev/shm:/dev/shm \ +# --name chrome \ +# jess/chrome:beta +# + # Base docker image -FROM debian:jessie +FROM debian:sid MAINTAINER Jessica Frazelle ADD https://dl.google.com/linux/direct/google-talkplugin_current_amd64.deb /src/google-talkplugin_current_amd64.deb -ADD https://dl.google.com/linux/direct/google-chrome-beta_current_amd64.deb /src/google-chrome-beta_current_amd64.deb - # Install Chrome RUN echo 'deb http://httpredir.debian.org/debian testing main' >> /etc/apt/sources.list && \ apt-get update && apt-get install -y \ ca-certificates \ - fonts-liberation \ - fonts-roboto \ - gconf-service \ + curl \ hicolor-icon-theme \ - libappindicator1 \ - libasound2 \ - libcanberra-gtk-module \ - libcurl3 \ - libexif-dev \ - libfontconfig1 \ - libfreetype6 \ - libgconf-2-4 \ libgl1-mesa-dri \ libgl1-mesa-glx \ - libnspr4 \ - libnss3 \ - libpango1.0-0 \ libv4l-0 \ - libxss1 \ - libxtst6 \ - lsb-base \ - strace \ - wget \ - xdg-utils \ -t testing \ fonts-symbola \ - --no-install-recommends && \ - dpkg -i '/src/google-chrome-beta_current_amd64.deb' && \ - dpkg -i '/src/google-talkplugin_current_amd64.deb' \ + --no-install-recommends \ + && curl -sSL https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \ + && echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list \ + && apt-get update && apt-get install -y \ + google-chrome-beta \ + --no-install-recommends \ + && dpkg -i '/src/google-talkplugin_current_amd64.deb' \ + && apt-get purge --auto-remove -y curl \ && rm -rf /var/lib/apt/lists/* \ && rm -rf /src/*.deb COPY local.conf /etc/fonts/local.conf # Autorun chrome -ENTRYPOINT [ "/usr/bin/google-chrome" ] +ENTRYPOINT [ "google-chrome" ] CMD [ "--user-data-dir=/data" ] diff --git a/chrome/stable/Dockerfile b/chrome/stable/Dockerfile index e47536f..b185e77 100644 --- a/chrome/stable/Dockerfile +++ b/chrome/stable/Dockerfile @@ -20,41 +20,25 @@ MAINTAINER Jessica Frazelle ADD https://dl.google.com/linux/direct/google-talkplugin_current_amd64.deb /src/google-talkplugin_current_amd64.deb -ADD https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb /src/google-chrome-stable_current_amd64.deb - # Install Chrome RUN echo 'deb http://httpredir.debian.org/debian testing main' >> /etc/apt/sources.list && \ apt-get update && apt-get install -y \ ca-certificates \ - fonts-liberation \ - fonts-roboto \ - gconf-service \ + curl \ hicolor-icon-theme \ - libappindicator1 \ - libasound2 \ - libcanberra-gtk-module \ - libcurl3 \ - libexif-dev \ - libfontconfig1 \ - libfreetype6 \ - libgconf-2-4 \ libgl1-mesa-dri \ libgl1-mesa-glx \ - libnspr4 \ - libnss3 \ - libpango1.0-0 \ libv4l-0 \ - libxss1 \ - libxtst6 \ - lsb-base \ - strace \ - wget \ - xdg-utils \ -t testing \ fonts-symbola \ - --no-install-recommends && \ - dpkg -i '/src/google-chrome-stable_current_amd64.deb' && \ - dpkg -i '/src/google-talkplugin_current_amd64.deb' \ + --no-install-recommends \ + && curl -sSL https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \ + && echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list \ + && apt-get update && apt-get install -y \ + google-chrome-stable \ + --no-install-recommends \ + && dpkg -i '/src/google-talkplugin_current_amd64.deb' \ + && apt-get purge --auto-remove -y curl \ && rm -rf /var/lib/apt/lists/* \ && rm -rf /src/*.deb diff --git a/mutt/.mutt/muttrc b/mutt/.mutt/muttrc index 19b0fc0..2847dd8 100644 --- a/mutt/.mutt/muttrc +++ b/mutt/.mutt/muttrc @@ -22,7 +22,7 @@ my_hdr X-Hack-The-Planet: Yes my_hdr X-Acid-Burn: Yes # TODO figure out how to use the sidebar more effectively :) -set sidebar_visible = no +#set sidebar_visible = no # Tianon keybindings and settings, because he's special. bind pager previous-line diff --git a/mutt/Dockerfile b/mutt/Dockerfile index fd12cc4..b9e39d4 100644 --- a/mutt/Dockerfile +++ b/mutt/Dockerfile @@ -8,30 +8,29 @@ # --name mutt \ # jess/mutt # -FROM debian:sid +FROM alpine:latest MAINTAINER Jessica Frazelle -RUN groupadd -g 1000 user \ - && useradd --create-home -d /home/user -g user -u 1000 user +RUN addgroup -g 1000 user \ + && adduser -D -h /home/user -G user -u 1000 user -RUN apt-get update && apt-get install -y \ +RUN apk --update add \ ca-certificates \ elinks \ git \ - libsasl2-modules \ + gnupg \ lynx \ - mutt-dbg \ - mutt-patched \ - vim-nox \ - --no-install-recommends \ - && rm -rf /var/lib/apt/lists/* + mutt \ + mutt-doc \ + vim \ + && rm -rf /var/cache/apk/* # a browser is necessary! ENV BROWSER lynx USER user ENV HOME /home/user -ENV TERM xterm-256color +ENV TERM xterm RUN mkdir -p $HOME/.mutt/cache/headers $HOME/.mutt/cache/bodies \ && touch $HOME/.mutt/certificates @@ -47,4 +46,4 @@ COPY .mutt $HOME/.mutt ENTRYPOINT ["/entrypoint.sh"] -CMD ["mutt-patched", "-F", "~/.mutt/muttrc"] +CMD ["mutt", "-F", "~/.mutt/muttrc"] diff --git a/mutt/entrypoint.sh b/mutt/entrypoint.sh index 96cc015..5f90b81 100755 --- a/mutt/entrypoint.sh +++ b/mutt/entrypoint.sh @@ -1,7 +1,7 @@ -#!/bin/bash +#!/bin/sh set -e -if [[ -z "$GMAIL" ]]; then +if [ -z "$GMAIL" ]; then echo >&2 'error: missing GMAIL environment variable' echo >&2 ' try running again with -e GMAIL=your-email@gmail.com' echo >&2 ' optionally, you can also specify -e GMAIL_PASS' @@ -10,19 +10,19 @@ if [[ -z "$GMAIL" ]]; then exit 1 fi -if [[ -z "$GMAIL_NAME" ]]; then +if [ -z "$GMAIL_NAME" ]; then GMAIL_NAME="$GMAIL" fi -if [[ -z "$GMAIL_FROM" ]]; then +if [ -z "$GMAIL_FROM" ]; then GMAIL_FROM="$GMAIL" fi -if [[ -z "$IMAP_SERVER" ]]; then +if [ -z "$IMAP_SERVER" ]; then IMAP_SERVER="imap.gmail.com:993" fi -if [[ -z "$SMTP_SERVER" ]]; then +if [ -z "$SMTP_SERVER" ]; then SMTP_SERVER="smtp.gmail.com" fi @@ -33,12 +33,17 @@ sed -i "s/%GMAIL_FROM%/$GMAIL_FROM/g" "$HOME/.mutt/muttrc" sed -i "s/%IMAP_SERVER%/$IMAP_SERVER/g" "$HOME/.mutt/muttrc" sed -i "s/%SMTP_SERVER%/$SMTP_SERVER/g" "$HOME/.mutt/muttrc" -if [[ -d "$HOME/.gnupg" ]]; then +if [ -d "$HOME/.gnupg" ]; then # sane gpg settings to be a good encryption # social citizen of the world { echo - echo 'source /usr/share/doc/mutt/examples/gpg.rc' + if [ -f "/usr/share/doc/mutt/samples/gpg.rc" ]; then + echo 'source /usr/share/doc/mutt/samples/gpg.rc' + fi + if [ -f "/usr/share/doc/mutt/examples/gpg.rc" ]; then + echo 'source /usr/share/doc/mutt/examples/gpg.rc' + fi if [[ ! -z "$GPG_ID" ]]; then echo "set pgp_sign_as = $GPG_ID" fi @@ -58,7 +63,7 @@ if [[ -d "$HOME/.gnupg" ]]; then } >> "$HOME/.mutt/muttrc" fi -if [[ -e "$HOME/.muttrc.local" ]]; then +if [ -e "$HOME/.muttrc.local" ]; then echo "source $HOME/.muttrc.local" >> "$HOME/.mutt/muttrc" fi