From 7dbd29f18f1539f6cf2fb51d2a2e0e36c89be5a4 Mon Sep 17 00:00:00 2001 From: Fletcher Nichol Date: Mon, 16 May 2016 10:17:17 -0600 Subject: [PATCH] [devshell] Upgrade to xenial & add Rust musl target support. Signed-off-by: Fletcher Nichol --- .dockerignore | 1 + Dockerfile | 24 ++++++++++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.dockerignore b/.dockerignore index e7e7a581fb3..7dfced38689 100644 --- a/.dockerignore +++ b/.dockerignore @@ -10,6 +10,7 @@ log plans support !support/init.sh +tmp vendor www *.md diff --git a/Dockerfile b/Dockerfile index a21af2d6e37..8c445683af5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:wily +FROM ubuntu:xenial MAINTAINER The Habitat Maintainers RUN apt-get update && apt-get install -y --no-install-recommends \ @@ -14,14 +14,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libssl-dev \ libczmq-dev \ man \ + musl-tools \ npm \ pkg-config \ protobuf-compiler \ sudo \ tmux \ vim \ - wget \ - && rm -rf /var/lib/apt/lists/* + wget ENV CARGO_HOME /cargo-cache ENV PATH $PATH:$CARGO_HOME/bin:/root/.cargo/bin @@ -29,14 +29,22 @@ ENV PATH $PATH:$CARGO_HOME/bin:/root/.cargo/bin ARG HAB_DEPOT_URL ENV HAB_DEPOT_URL ${HAB_DEPOT_URL:-} -RUN curl -s https://static.rust-lang.org/rustup.sh | sh -s -- -y && rustc -V -RUN curl -sSL https://get.docker.io | sh && docker -v +RUN curl -s https://static.rust-lang.org/rustup.sh | sh -s -- -y \ + && RUST_VERSION=$(rustc -V | cut -d ' ' -f 2) \ + && URL=http://static.rust-lang.org/dist/rust-std-${RUST_VERSION}-x86_64-unknown-linux-musl.tar.gz \ + && mkdir -p /prep/rust-std-musl \ + && (cd /prep && curl -LO $URL) \ + && tar xf /prep/$(basename $URL) -C /prep/rust-std-musl --strip-components=1 \ + && (cd /prep/rust-std-musl && ./install.sh --prefix=$(rustc --print sysroot)) \ + && rm -rf /prep \ + && rustc -V +RUN env -u CARGO_HOME cargo install protobuf && rm -rf /root/.cargo/registry + +RUN curl -sSL https://get.docker.io | sh && rm -rf /var/lib/apt/lists/* && docker -v RUN ln -snf /usr/bin/nodejs /usr/bin/node && npm install -g docco && echo "docco `docco -V`" RUN (adduser --system hab || true) && (addgroup --system hab || true) -RUN env -u CARGO_HOME cargo install protobuf && rm -rf /root/.cargo/registry - COPY .delivery/scripts/ssh_wrapper.sh /usr/local/bin COPY .delivery/scripts/git_src_checkout.sh /usr/local/bin COPY components/studio/install.sh /tmp @@ -45,7 +53,7 @@ RUN /tmp/install.sh \ && hab-bpm install core/busybox-static \ && (cd /tmp && curl -sLO https://s3-us-west-2.amazonaws.com/fnichol-lfs-tools/core-20160423193745.pub) \ && chmod 755 /init.sh \ - && rm -f /tmp/install.sh /hab/cache/artifacts/* + && rm -rf /tmp/install.sh /hab/cache/artifacts WORKDIR /src # This entrypoint is temporary until origin key download on install is implemented