Skip to content

Commit

Permalink
add alpine 3.6 image and set to latest tag
Browse files Browse the repository at this point in the history
  • Loading branch information
chusiang committed Jun 21, 2017
1 parent f6cfeaa commit 513d697
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 7 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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

Expand Down
34 changes: 34 additions & 0 deletions alpine-3.6/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM alpine:3.6

MAINTAINER Chu-Siang Lai <[email protected]>

# 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" ]
15 changes: 15 additions & 0 deletions alpine-3.6/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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
9 changes: 6 additions & 3 deletions bin/retag_latest.sh
Original file line number Diff line number Diff line change
@@ -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.'
Expand Down

0 comments on commit 513d697

Please sign in to comment.