blob: 45c85c85b1ec4044efa66713f544cf9c6b32f582 [file] [log] [blame]
FROM ubuntu
RUN /usr/sbin/useradd -d /home/playground -m playground
# Install various prereqs.
RUN apt-get update
RUN apt-get install -y curl git nodejs npm
# node -> nodejs needed for Ubuntu.
RUN ln -s "$(which nodejs)" "$(dirname $(which nodejs))/node"
# Install Go. Note, the apt-get "golang" target is too old.
RUN (cd /tmp; curl -O https://storage.googleapis.com/golang/go1.4.linux-amd64.tar.gz)
RUN tar -C /usr/local -xzf /tmp/go1.4.linux-amd64.tar.gz
ENV PATH /usr/local/go/bin:$PATH
ENV HOME /root
ENV VANADIUM_ROOT /usr/local/vanadium
ENV GOPATH $VANADIUM_ROOT/release/projects/playground/go
ENV VDLPATH $GOPATH
ENV PATH $VANADIUM_ROOT/release/projects/playground/go/bin:$VANADIUM_ROOT/release/go/bin:$VANADIUM_ROOT/bin:$PATH
# Setup Vanadium.
# Note: This will be cached! If you want to re-build the docker image using
# fresh Vanadium code, you must pass "--no-cache" to the docker build command.
# See README.md.
ADD deploy/netrc /root/.netrc
RUN curl -u vanadium:D6HT]P,LrJ7e https://dev.v.io/noproxy/bootstrap-vanadium.sh | bash
RUN rm /root/.netrc
# Install the release/javascript/core library.
# TODO(nlacasse): Switch to "npm install -g vanadium" once release/javascript/core
# is publicly visible in NPM.
# NOTE(sadovsky): NPM is flaky. If any of the NPM commands below fail, simply
# retry them.
WORKDIR /home/playground
RUN npm install --production $VANADIUM_ROOT/release/javascript/core
# Install builder and dependencies.
WORKDIR $VANADIUM_ROOT/release/projects/playground/go/src/playground
RUN make all
# Uncomment the following lines to install a version of the builder tool using
# your local version of the code. This is useful when developing and testing
# local changes.
#RUN rm -f $VANADIUM_ROOT/release/projects/playground/go/bin/builder
#RUN rm -rf $VANADIUM_ROOT/release/projects/playground/go/src/playground/Makefile
#RUN rm -rf $VANADIUM_ROOT/release/projects/playground/go/src/playground/builder/
#RUN rm -rf $VANADIUM_ROOT/release/projects/playground/go/src/playground/lib/
#ADD Makefile $VANADIUM_ROOT/release/projects/playground/go/src/playground/Makefile
#ADD builder/ $VANADIUM_ROOT/release/projects/playground/go/src/playground/builder/
#ADD lib/ $VANADIUM_ROOT/release/projects/playground/go/src/playground/lib/
#RUN make builder
USER playground
WORKDIR /home/playground
# exec form - passes through command-line arguments and signals.
ENTRYPOINT ["builder"]