From 33f61097bc355573c973a01f2854c5226933822e Mon Sep 17 00:00:00 2001 From: Jessica Frazelle Date: Tue, 9 Jun 2015 13:44:12 -0700 Subject: [PATCH] update consul Signed-off-by: Jessica Frazelle --- bashrc | 44 +++++++++++++++++++++-------------------- consul/Dockerfile | 19 +++++++++++------- visualstudio/Dockerfile | 29 ++++++++++++++++++++++----- visualstudio/start.sh | 3 +++ 4 files changed, 62 insertions(+), 33 deletions(-) create mode 100755 visualstudio/start.sh diff --git a/bashrc b/bashrc index a43bd20..7370c01 100644 --- a/bashrc +++ b/bashrc @@ -1,23 +1,25 @@ +#!/bin/bash + command_not_found_handle () { - # Check if there is a container image with that name - if ! docker inspect --format '{{ .Author }}' "$1" >&/dev/null - then - echo "$0: $1: command not found" - return - fi - # Check that it's really the name of the image, not a prefix - if docker inspect --format '{{ .Id }}' "$1" | grep -q "^$1" - then - echo "$0: $1: command not found" - return - fi - docker run -ti -u $(whoami) -w "$HOME" \ - $(env | cut -d= -f1 | awk '{print "-e", $1}') \ - -v /dev/snd:/dev/snd \ - -v /etc/passwd:/etc/passwd:ro \ - -v /etc/group:/etc/group:ro \ - -v /etc/localtime:/etc/localtime:ro \ - -v /home:/home \ - -v /tmp/.X11-unix:/tmp/.X11-unix \ - "$@" + # Check if there is a container image with that name + if ! docker inspect --format '{{ .Author }}' "$1" >&/dev/null; then + echo "$0: $1: command not found" + return + fi + + # Check that it's really the name of the image, not a prefix + if docker inspect --format '{{ .Id }}' "$1" | grep -q "^$1" ;then + echo "$0: $1: command not found" + return + fi + + docker run -ti -u $(whoami) -w "$HOME" \ + $(env | cut -d= -f1 | awk '{print "-e", $1}') \ + -v /dev/snd:/dev/snd \ + -v /etc/passwd:/etc/passwd:ro \ + -v /etc/group:/etc/group:ro \ + -v /etc/localtime:/etc/localtime:ro \ + -v /home:/home \ + -v /tmp/.X11-unix:/tmp/.X11-unix \ + "$@" } diff --git a/consul/Dockerfile b/consul/Dockerfile index 9d2c4c6..a03a2a2 100644 --- a/consul/Dockerfile +++ b/consul/Dockerfile @@ -1,17 +1,22 @@ FROM debian:jessie MAINTAINER Jessica Frazelle +RUN apt-get update && apt-get install -y \ + ca-certificates \ + curl \ + unzip \ + --no-install-recommends \ + && rm -rf /var/lib/apt/lists/* + ENV CONSUL_VERSION 0.5.2 ADD https://jesss.s3.amazonaws.com/binaries/consul/${CONSUL_VERSION}/consul /usr/local/bin/consul ADD https://jesss.s3.amazonaws.com/binaries/curl-unix-socket /usr/local/bin/curl-unix-socket -COPY ./dist/ /usr/src/consul - -RUN apt-get update && apt-get install -y \ - ca-certificates \ - curl \ - --no-install-recommends \ - && rm -rf /var/lib/apt/lists/* \ +# download the ui +RUN curl -sSL https://jesss.s3.amazonaws.com/binaries/consul/${CONSUL_VERSION}/ui.zip -o /tmp/ui.zip \ + && unzip /tmp/ui.zip -d /usr/src/ \ + && rm -rf /tmp/ui.zip \ + && mv /usr/src/dist /usr/src/consul \ && mkdir -p /etc/consul.d/ \ && chmod +x /usr/local/bin/consul \ && chmod +x /usr/local/bin/curl-unix-socket diff --git a/visualstudio/Dockerfile b/visualstudio/Dockerfile index 9b7d4c0..e0d3dea 100644 --- a/visualstudio/Dockerfile +++ b/visualstudio/Dockerfile @@ -1,10 +1,21 @@ -FROM debian:jessie +# Visual Studio in a container +# NOTE: Needs the redering device (yeah... idk) +# +# docker run -d \ +# -v /tmp/.X11-unix:/tmp/.X11-unix \ +# -e DISPLAY=unix$DISPLAY \ +# --device /dev/dri \ +# --name visualstudio \ +# jess/visualstudio + +FROM jess/chromium MAINTAINER Jessica Frazelle RUN apt-get update && apt-get install -y \ build-essential \ ca-certificates \ curl \ + git \ libasound2 \ libgconf-2-4 \ libgnome-keyring-dev \ @@ -13,18 +24,26 @@ RUN apt-get update && apt-get install -y \ libpci3 \ libxtst6 \ unzip \ - zip \ --no-install-recommends +ENV HOME /home/user +RUN useradd --create-home --home-dir $HOME user \ + && chown -R user:user $HOME + # install node RUN curl -sL https://deb.nodesource.com/setup | bash - RUN apt-get update && apt-get install -y \ nodejs \ - && rm -rf /var/lib/apt/lists/* + && rm -rf /var/lib/apt/lists/* \ + && npm update -g # download the source RUN curl -sSL https://jesss.s3.amazonaws.com/binaries/VSCode-linux-x64.zip -o /tmp/vs.zip \ && unzip /tmp/vs.zip -d /usr/src/ \ - && rm -rf /tmp/vs.zip + && rm -rf /tmp/vs.zip \ + && ln -snf /usr/src/VSCode-linux-x64/Code /usr/local/bin/code -ENTRYPOINT [ "/usr/src/VSCode-linux-x64/Code" ] +COPY start.sh /usr/local/bin/start.sh +WORKDIR $HOME + +ENTRYPOINT [ "/usr/local/bin/start.sh" ] diff --git a/visualstudio/start.sh b/visualstudio/start.sh new file mode 100755 index 0000000..b65ce2b --- /dev/null +++ b/visualstudio/start.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +su user -c code