diff --git a/README.md b/README.md index 6e8cf3c..e53bc2b 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,8 @@ A Docker image for run [Ansible][ansible_official] 2.3 on [Jupyter Notebook][jup ## Supported tags and respective `Dockerfile` links -- `alpine-3.4`, `latest` [*(alpine/Dockerfile)*][dockerfile_alpine] +- `alpine-3.4` [*(alpine-3.4/Dockerfile)*][dockerfile_alpine-3.4] +- `alpine-3.6`, `latest` [*(alpine-3.6/Dockerfile)*][dockerfile_alpine-3.6] - `archlinux` [*(archlinux/Dockerfile)*][dockerfile_archlinux] - `centos-7` [*(centos-7/Dockerfile)*][dockerfile_centos-7] - `debian-7` [*(debian-7/Dockerfile)*][dockerfile_debian-7] @@ -19,13 +20,14 @@ A Docker image for run [Ansible][ansible_official] 2.3 on [Jupyter Notebook][jup - `ubuntu-14.04` [*(ubuntu-14.04/Dockerfile)*][dockerfile_ubuntu-14.04] - `ubuntu-16.04` [*(ubuntu-16.04/Dockerfile)*][dockerfile_ubuntu-16.04] -[dockerfile_alpine]: https://github.com/chusiang/ansible-jupyter.dockerfile/blob/master/alpine/Dockerfile -[dockerfile_archlinux]: https://github.com/chusiang/ansible-jupyter.dockerfile/blob/master/archlinux/Dockerfile +[dockerfile_alpine-3.4]: https://github.com/chusiang/ansible-jupyter.dockerfile/blob/master/alpine-3.4/Dockerfile +[dockerfile_alpine-3.6]: https://github.com/chusiang/ansible-jupyter.dockerfile/blob/master/alpine-3.6/Dockerfile +[dockerfile_archlinux]: https://github.com/chusiang/ansible-jupyter.dockerfile/blob/master/archlinux/Dockerfile [dockerfile_centos-7]: https://github.com/chusiang/ansible-jupyter.dockerfile/blob/master/centos-7/Dockerfile [dockerfile_debian-7]: https://github.com/chusiang/ansible-jupyter.dockerfile/blob/master/debian-7/Dockerfile [dockerfile_debian-8]: https://github.com/chusiang/ansible-jupyter.dockerfile/blob/master/debian-8/Dockerfile [dockerfile_gentoo]: https://github.com/chusiang/ansible-jupyter.dockerfile/blob/master/gentoo/Dockerfile -[dockerfile_opensuse-42.1]: https://github.com/chusiang/ansible-jupyter.dockerfile/blob/master/opensuse-42.1/Dockerfile +[dockerfile_opensuse-42.1]: https://github.com/chusiang/ansible-jupyter.dockerfile/blob/master/opensuse-42.1/Dockerfile [dockerfile_ubuntu-14.04]: https://github.com/chusiang/ansible-jupyter.dockerfile/blob/master/ubuntu-14.04/Dockerfile [dockerfile_ubuntu-16.04]: https://github.com/chusiang/ansible-jupyter.dockerfile/blob/master/ubuntu-16.04/Dockerfile diff --git a/alpine-3.6/Dockerfile b/alpine-3.6/Dockerfile new file mode 100644 index 0000000..7a500af --- /dev/null +++ b/alpine-3.6/Dockerfile @@ -0,0 +1,34 @@ +FROM alpine:3.6 + +MAINTAINER Chu-Siang Lai + +# Update the index of available packages. +RUN apk update + +# Install the requires apk package and python. +RUN apk add --no-cache linux-headers gcc build-base python py-pip python-dev \ + libffi-dev openssl-dev ca-certificates + +# Upgrade the pip to lastest. +RUN pip install -U pip + +# Setup the ansible. +RUN pip install ansible + +# for disable localhost warning message. +RUN mkdir /etc/ansible && \ + /bin/echo -e "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts + +# Setup with Ansible. +ADD https://raw.githubusercontent.com/chusiang/ansible-jupyter.dockerfile/master/setup_jupyter.yml /home +RUN ansible-playbook -vvvv /home/setup_jupyter.yml + +# Copy a ipython notebook example to image. +ADD https://raw.githubusercontent.com/chusiang/ansible-jupyter.dockerfile/master/ipynb/ansible_on_jupyter.ipynb /home/ + +# Run service of Jupyter. +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT [ "docker-entrypoint.sh" ] +EXPOSE 8888 + +CMD [ "jupyter", "--version" ] diff --git a/alpine-3.6/docker-entrypoint.sh b/alpine-3.6/docker-entrypoint.sh new file mode 100755 index 0000000..d243fa5 --- /dev/null +++ b/alpine-3.6/docker-entrypoint.sh @@ -0,0 +1,15 @@ +#!/bin/sh +# ============================================================ +# Author: Chu-Siang Lai / chusiang (at) drx.tw +# Blog: http://note.drx.tw +# Filename: docker-entrypoint.sh +# Modified: 2016-11-20 18:43 +# Description: Run the jupyter service. +# +# --ip 0.0.0.0: Allow all IP access. +# --no-browser: Don't open browser from command line. +# --notebook-dir: Bunding the workdir. +# +# =========================================================== + +jupyter-notebook --ip 0.0.0.0 --no-browser --allow-root --notebook-dir=/home diff --git a/bin/retag_latest.sh b/bin/retag_latest.sh index b7f61e2..a9f54b2 100755 --- a/bin/retag_latest.sh +++ b/bin/retag_latest.sh @@ -1,15 +1,18 @@ #!/bin/bash +DOCKER_IMAGE="chusiang/ansible-jupyter" +DOCKER_TAG="alpine-3.6" + echo 'Pull alpine image.' -docker pull chusiang/ansible-jupyter:alpine-3.4 +docker pull $DOCKER_IMAGE:$DOCKER_TAG echo echo 'Tag alpine image to latest.' -docker tag chusiang/ansible-jupyter:alpine-3.4 chusiang/ansible-jupyter:latest +docker tag $DOCKER_IMAGE:$DOCKER_TAG $DOCKER_IMAGE:latest echo echo 'Push the latest tag.' -docker push chusiang/ansible-jupyter:latest +docker push $DOCKER_IMAGE:latest echo echo 'Remove old image.'