Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use jupyter/base-notebook as base docker image #416

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 22 additions & 2 deletions Dockerfile
Expand Up @@ -6,12 +6,32 @@
# Can be used to create an image with a locally built almond that isn't on maven central yet.
ARG LOCAL_IVY=no

FROM almondsh/almond:coursier as local_ivy_yes
FROM jupyter/base-notebook as coursier_base

USER root

RUN apt-get -y update && \
apt-get install --no-install-recommends -y \
curl \
openjdk-8-jre-headless \
ca-certificates-java && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

RUN curl -Lo /usr/local/bin/coursier https://github.com/coursier/coursier/releases/download/v2.0.0-RC3-2/coursier && \
chmod +x /usr/local/bin/coursier

USER $NB_UID

# ensure the JAR of the CLI is in the coursier cache, in the image
RUN /usr/local/bin/coursier --help

FROM coursier_base as local_ivy_yes
USER $NB_UID
ONBUILD RUN mkdir -p .ivy2/local/
ONBUILD COPY --chown=1000:100 ivy-local/ .ivy2/local/

FROM almondsh/almond:coursier as local_ivy_no
FROM coursier_base as local_ivy_no

FROM local_ivy_${LOCAL_IVY}
ARG ALMOND_VERSION
Expand Down
10 changes: 5 additions & 5 deletions scripts/update-docker-images.sh
Expand Up @@ -2,7 +2,7 @@
set -e

SCALA212_VERSION="$(grep -oP '(?<=def scala212 = ")[^"]*(?<!")' project/Settings.scala)"
SCALA211_VERSION="$(grep -oP '(?<=def scala211 = ")[^"]*(?<!")' project/Settings.scala)"
SCALA213_VERSION="$(grep -oP '(?<=def scala213 = ")[^"]*(?<!")' project/Settings.scala)"

ALMOND_VERSION="$(git describe --tags --abbrev=0 --match 'v*' | sed 's/^v//')"

Expand All @@ -17,19 +17,19 @@ if [[ ${TRAVIS_TAG} != v* ]]; then
sbt 'set version in ThisBuild := "'${ALMOND_VERSION}'"' '+ publishLocal'
cp -r $HOME/.ivy2/local/ ivy-local/
docker build --build-arg ALMOND_VERSION=${ALMOND_VERSION} --build-arg=LOCAL_IVY=yes \
--build-arg SCALA_VERSIONS="$SCALA211_VERSION $SCALA212_VERSION" -t ${IMAGE_NAME} .
--build-arg SCALA_VERSIONS="$SCALA213_VERSION $SCALA212_VERSION" -t ${IMAGE_NAME} .
docker push ${IMAGE_NAME}
else
echo "Creating release images for almond ${ALMOND_VERSION}"
IMAGE_NAME=${DOCKER_REPO}:${ALMOND_VERSION}
docker build --build-arg ALMOND_VERSION=${ALMOND_VERSION} \
--build-arg SCALA_VERSIONS="$SCALA211_VERSION $SCALA212_VERSION" -t ${IMAGE_NAME} .
--build-arg SCALA_VERSIONS="$SCALA213_VERSION $SCALA212_VERSION" -t ${IMAGE_NAME} .
docker build --build-arg ALMOND_VERSION=${ALMOND_VERSION} \
--build-arg SCALA_VERSIONS="$SCALA211_VERSION" -t ${IMAGE_NAME}-scala-${SCALA211_VERSION} .
--build-arg SCALA_VERSIONS="$SCALA213_VERSION" -t ${IMAGE_NAME}-scala-${SCALA213_VERSION} .
docker build --build-arg ALMOND_VERSION=${ALMOND_VERSION} \
--build-arg SCALA_VERSIONS="$SCALA212_VERSION" -t ${IMAGE_NAME}-scala-${SCALA212_VERSION} .

docker push ${IMAGE_NAME}-scala-${SCALA211_VERSION}
docker push ${IMAGE_NAME}-scala-${SCALA213_VERSION}
docker push ${IMAGE_NAME}-scala-${SCALA212_VERSION}
docker push ${IMAGE_NAME}
docker tag ${IMAGE_NAME} ${DOCKER_REPO}:latest
Expand Down