From e2033fc46de5599f218f52e3018a14089173df0f Mon Sep 17 00:00:00 2001 From: Christoph Schranz Date: Sat, 22 Feb 2020 14:51:28 +0100 Subject: [PATCH] optimized workflow and used the Dockerfile in . --- Dockerfile | 6 ++++++ docker-compose-swarm.yml | 2 +- docker-compose.yml | 2 +- generate_Dockerfile.sh | 3 ++- run_Dockerfile.sh | 28 ---------------------------- 5 files changed, 10 insertions(+), 31 deletions(-) delete mode 100644 run_Dockerfile.sh diff --git a/Dockerfile b/Dockerfile index 730f8f6..9dba4af 100644 --- a/Dockerfile +++ b/Dockerfile @@ -395,6 +395,12 @@ RUN conda update -n base conda -y USER root +# Install elasticsearch libs +USER root +RUN apt-get update \ + && curl -sL https://repo1.maven.org/maven2/org/elasticsearch/elasticsearch-hadoop/6.8.1/elasticsearch-hadoop-6.8.1.jar +RUN pip install --no-cache-dir elasticsearch==7.1.0 + # Install rpy2 to share data between Python and R RUN conda install rpy2=2.9.4 plotly=4.4.1 RUN conda install -c conda-forge ipyleaflet diff --git a/docker-compose-swarm.yml b/docker-compose-swarm.yml index de42cbb..8d61dd7 100755 --- a/docker-compose-swarm.yml +++ b/docker-compose-swarm.yml @@ -2,7 +2,7 @@ version: "3.4" services: gpu-jupyter: image: 127.0.0.1:$REGISTRY_PORT/gpu-jupyter - build: ./src/ + build: . ports: - $JUPYTER_PORT:8888 volumes: diff --git a/docker-compose.yml b/docker-compose.yml index 1fc3c20..e40490e 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.4" services: gpu-jupyter: image: 127.0.0.1:5001/gpu-jupyter - build: ./src/ + build: . ports: - ${JUPYTER_PORT}:8888 volumes: diff --git a/generate_Dockerfile.sh b/generate_Dockerfile.sh index 7887da1..095ef09 100644 --- a/generate_Dockerfile.sh +++ b/generate_Dockerfile.sh @@ -9,7 +9,8 @@ export STACKS_DIR=".build/docker-stacks" # Clone if docker-stacks doesn't exist, and pull. ls $STACKS_DIR/README.md > /dev/null 2>&1 || (echo "Docker-stacks was not found, cloning repository" \ && git clone https://github.com/jupyter/docker-stacks.git $STACKS_DIR) -git pull -f $STACKS_DIR +cd $STACKS_DIR && git pull && cd - + # Write the contents into the DOCKERFILE and start with the header cat src/Dockerfile.header > $DOCKERFILE diff --git a/run_Dockerfile.sh b/run_Dockerfile.sh deleted file mode 100644 index eeb1f9d..0000000 --- a/run_Dockerfile.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash -cd $(cd -P -- "$(dirname -- "$0")" && pwd -P) - -# Fetching port -PORT=0 -HELP=0 -while [[ "$#" -gt 0 ]]; do case $1 in - -p|--port) PORT="$2"; shift;; - -h|--help) HELP=1;; - *) echo "Unknown parameter passed: $1"; exit 1;; -esac; shift; done - -# Print help -if [[ $HELP != 0 ]]; then - echo "Usage: $0 -p [port] # port must be an integer with 4 or more digits." - exit 21 -fi - -# Check if port is valid -if [[ $PORT != [0-9][0-9][0-9][0-9]* ]]; then - echo "The port is not set or invalid." - echo "Usage: $0 -p [port] # port must be an integer with 4 or more digits." - exit 22 -fi - -# Build and run the Dockerfile -docker build -t gpu-jupyter . -docker run -d -p "$PORT":8888 gpu-jupyter