Skip to content

Commit

Permalink
Update Dockerfile to install shiny-examples from currently checked-ou…
Browse files Browse the repository at this point in the history
…t branch
  • Loading branch information
wch committed Apr 18, 2019
1 parent a828a81 commit fed570e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
14 changes: 10 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# To build, cd to this directory, then:
# docker build -t ss-shiny-devel .
#
# If you are not on the master branch and would like to build with
# shiny-examples from your branch, run:
# docker build --build-arg SHINY_EXAMPLES_BRANCH=$(git symbolic-ref --short -q HEAD) -t ss-shiny-devel .
#
# To run with the built-in shiny-examples:
# docker run --rm -p 3838:3838 --name ss ss-shiny-devel

Expand Down Expand Up @@ -113,12 +117,14 @@ RUN R -e "devtools::install_github('rstudio/rsconnect')"

# Install shiny-examples, and fix permissions for apps that require write
# access.
ARG SHINY_EXAMPLES_BRANCH=master
ENV SHINY_EXAMPLES_BRANCH=$SHINY_EXAMPLES_BRANCH
RUN cd /srv && \
mv shiny-server shiny-server-orig && \
wget -nv https://github.com/rstudio/shiny-examples/archive/master.zip && \
unzip -x master.zip && \
mv shiny-examples-master shiny-server && \
rm master.zip && \
wget -nv https://github.com/rstudio/shiny-examples/archive/${SHINY_EXAMPLES_BRANCH}.zip && \
unzip -x ${SHINY_EXAMPLES_BRANCH}.zip && \
mv shiny-examples-${SHINY_EXAMPLES_BRANCH} shiny-server && \
rm ${SHINY_EXAMPLES_BRANCH}.zip && \
cd shiny-server && \
chmod 777 022-unicode-chinese 055-observer-demo 059-reactive-poll-and-file-reader

Expand Down
8 changes: 8 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ To build the Docker image, start in the shiny-examples directory and run:
docker build -t ss-shiny-devel docker/
```

If you are not on the master branch and would like to build with shiny-examples from your current branch, run:

```sh
docker build --build-arg SHINY_EXAMPLES_BRANCH=$(git symbolic-ref --short -q HEAD) -t ss-shiny-devel .
```

This will tell it to install shiny-examples from your currently checked-out branch. (`git symbolic-ref --short -q HEAD` returns the name of the current branch.)

### Running the image

Option 1: Run Shiny Server with the already-installed shiny-examples:
Expand Down

0 comments on commit fed570e

Please sign in to comment.