Skip to content

Commit

Permalink
Updatet shiny image
Browse files Browse the repository at this point in the history
  • Loading branch information
bunop committed May 6, 2018
1 parent 7e973a2 commit fe8b6d1
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 31 deletions.
32 changes: 6 additions & 26 deletions Services/Rocker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@

#
# VERSION 0.7
# VERSION 0.8
# DOCKER-VERSION 17.05.0-ce
# AUTHOR: Paolo Cozzi <[email protected]>
# DESCRIPTION: A rocker container with some packages and users added
# TO_BUILD: docker build --rm -t ptp/rstudio .
# TO_TAG: docker tag ptp/rstudio:latest ptp/rstudio:0.7
# CREATE_VOLUME: docker create --name rstudio_volume ptp/rstudio:0.7 /bin/true
# TO_RUN: docker run -d -p 8787:8787 -P --name rstudio --volumes-from rstudio_volume -v /etc/localtime:/etc/localtime:ro -v /mnt/storage/:/storage/ ptp/rstudio:0.7
# TO_TAG: docker tag ptp/rstudio:latest ptp/rstudio:0.8
# CREATE_VOLUME: docker create --name rstudio_volume ptp/rstudio:0.8 /bin/true
# TO_RUN: docker run -d -p 8787:8787 -P --name rstudio --volumes-from rstudio_volume -v /etc/localtime:/etc/localtime:ro -v /mnt/storage/:/storage/ ptp/rstudio:0.8
#

FROM rocker/rstudio
Expand All @@ -34,24 +34,9 @@ RUN rm -rf /var/lib/apt/lists/ && \
texlive-fonts-recommended \
texlive-latex-recommended \
texlive-latex-extra && \
openjdk-9-jdk && \
apt-get clean && rm -rf /var/lib/apt/lists/

# Instructions to install java JDK under rstudio image: https://github.com/cardcorp/card-rocker/blob/master/r-java/Dockerfile
RUN echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" \
| tee /etc/apt/sources.list.d/webupd8team-java.list \
&& echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" \
| tee -a /etc/apt/sources.list.d/webupd8team-java.list \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886 \
&& echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true" \
| /usr/bin/debconf-set-selections \
&& apt-get update \
&& apt-get install -y oracle-java8-installer \
&& update-alternatives --display java \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean \
&& R CMD javareconf \
&& apt-get clean && rm -rf /var/lib/apt/lists/

# Runnig rstudio instance need to be restarted (rstudio-server restart). There are no problems when building
# a new rstudio image

Expand Down Expand Up @@ -98,11 +83,6 @@ RUN addgroup --gid 505 biscarinif && \
adduser biscarinif --uid 505 --gid 505 --disabled-password --gecos "Filippo Biscarini" && \
echo 'biscarinif:biscarinif' | chpasswd

# Another user
RUN addgroup --gid 517 capreraa && \
adduser capreraa --uid 517 --gid 517 --disabled-password --gecos "Andrea Caprera" && \
echo 'capreraa:capreraa' | chpasswd

# Another user
RUN addgroup --gid 533 masettig && \
adduser masettig --uid 533 --gid 533 --disabled-password --gecos "Giulia Masetti" && \
Expand All @@ -115,7 +95,7 @@ RUN addgroup --gid 1002 ngs && \
usermod -a -G ngs cozzip && \
usermod -a -G ngs giannicor && \
usermod -a -G ngs lazzarib && \
usermod -a -G ngs capreraa
usermod -a -G ngs biscarinif

# By default RStudio Server only allows normal (as opposed to system) users to
# successfully authenticate. The minimum user id is determined by reading the
Expand Down
17 changes: 16 additions & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ TODO
* more info on deleting images: [here][delete-images1] and [here][delete-images2]
* registri [API][registry-api]?


[delete-docker-registry-image]: https://github.com/burnettk/delete-docker-registry-image
[deploying-registry]: https://docs.docker.com/registry/deploying/
[registry-storage]: https://docs.docker.com/registry/configuration/#storage
Expand All @@ -21,3 +20,19 @@ TODO
[delete-images1]: https://stackoverflow.com/questions/25436742/deleting-images-from-a-private-docker-registry
[delete-images2]: https://forums.docker.com/t/delete-repository-from-v2-private-registry/16767
[registry-api]: https://docs.docker.com/registry/spec/api/

* Use [environment file][environment-file] to store environment variables in
docker composed images

[environment-file]: https://docs.docker.com/compose/compose-file/#environment

* Add [django-debug-toolbar][django-toolbar] to composed django image

[django-toolbar]: https://django-debug-toolbar.readthedocs.io/en/stable/index.html

* manage sensitive data using secret in docker-compose, as described
[here][secret1] and [here][secret2]

[secret1]: https://docs.docker.com/engine/swarm/secrets/#use-secrets-in-compose
[secret2]: https://docs.docker.com/compose/compose-file/#secrets

27 changes: 27 additions & 0 deletions compose/registry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,32 @@ Pull it back
$ docker pull registry.ptp/myfirstimage
```

Using docker-registry
---------------------

### Listing images

List all images in catalog (using httpie):

```
$ http https://<user>:<password>@registry.ptp/v2/_catalog
```

Getting all version for an image:

```
$ http https://<user>:<password>@registry.ptp/v2/<image>/tags/list
```

### Deleting images using delete-docker-registry-image

Deleting an image using the latest version of [delete-docker-registry-image](delete-docker-registry-image):

```
$ sudo ./delete_docker_registry_image.py --image <image>:latest
$ sudo ./delete_docker_registry_image.py --image <image>:<tag>
```

<!-- References -->

[docker-registry]: https://docs.docker.com/registry/
Expand All @@ -341,5 +367,6 @@ $ docker pull registry.ptp/myfirstimage
[private-docker-registry-configuration]: http://blog.agilepartner.net/private-docker-registry-configuration/
[supervisor-and-nginx]: https://www.kf-interactive.com/blog/roll-your-own-docker-registry-with-docker-compose-supervisor-and-nginx/
[nginx-proxy-examples]: https://github.com/kwk/docker-registry-frontend/wiki/nginx-proxy-examples
[delete-docker-registry-image]: https://github.com/burnettk/delete-docker-registry-image.git

<!-- Not used: http://blog.agilepartner.net/private-docker-registry-behind-an-httpd-reverse-proxy/ -->
10 changes: 6 additions & 4 deletions compose/shiny/shiny/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#
# VERSION 0.1
# DOCKER-VERSION 1.7.1
# VERSION 0.2
# DOCKER-VERSION 17.05.0-ce
# AUTHOR: Paolo Cozzi <[email protected]>
# DESCRIPTION: A shiny container based on rocker-shiny
# TO_BUILD: docker build --rm -t ptp/shiny .
# TO_RUN: docker run -d -P ptp/shiny
# TO_TAG: docker tag ptp/shiny:latest <name>:0.1
# TO_TAG: docker tag ptp/shiny:latest <name>:0.2
#

# Get the last rocker/shiny image
Expand All @@ -17,7 +17,9 @@ MAINTAINER Paolo Cozzi <[email protected]>
# install package dependencies
RUN apt-get update && apt-get install -y \
libssl-dev \
libxml2-dev
libxml2-dev \
openjdk-9-jdk \
&& apt-get clean && rm -rf /var/lib/apt/lists/

# Install R packages. Packages are listed in packages.txt
COPY install.r packages.txt /root/
Expand Down

0 comments on commit fe8b6d1

Please sign in to comment.