From a997cdaf015ce7811528684b3a4546cde3910949 Mon Sep 17 00:00:00 2001 From: Franco Masotti Date: Wed, 8 Feb 2017 16:07:57 +0100 Subject: [PATCH] Added distro package files. --- Makefile | 33 +++++++++++++-------------------- README.md | 13 ++++++++++--- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Makefile b/Makefile index 3ae818f..ecfe461 100644 --- a/Makefile +++ b/Makefile @@ -9,28 +9,21 @@ UHOME=/home/$(USER) MOUNT=-v /home/$(USER):/home/rserve all:: - @echo "Targets:" - @echo - @echo " load Loads the precompiled image" - @echo " run Run the image one time" - @echo " install Run the image with --restart=unless-stopped" - @echo " shell Run an interactive shell in the image" + @echo "Targets:" + @echo + @echo " load Loads the precompiled image" + @echo " remove remove the docker image" + @echo " run run the container one time" + @echo " stop quit and remove the current docker container" load: - docker load < $(SAVED_IMAGE) + docker load < $(SAVED_IMAGE) -run: - docker run --net=none --detach $(MOUNT) rserve - -install: - docker run --net=none --detach --restart=unless-stopped $(MOUNT) rserve - -shell: - docker run -it $(MOUNT) rserve /bin/bash +remove: + docker rmi -f rserve -user: $(UHOME) - -deluser: - sudo userdel $(USER) - sudo rm -rf $(UHOME) +run: + docker run --net=none --rm $(MOUNT) rserve +stop: + docker stop $$(docker ps --format "{{.ID}}\t{{.Image}}" | grep rserve | awk '{print $$1}') 1>/dev/null 2>/dev/null diff --git a/README.md b/README.md index b455e2d..c1cf719 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,9 @@ A precompiled version of `rserve-sandbox`. ## NOTE -Post +The Makefile in this branch is not intendended to be run manually. + +Post [installation](https://frnmst.github.io/swish-installer/swish-installer.html#Install-actions) and [remove](https://frnmst.github.io/swish-installer/swish-installer.html#Remove-actions) @@ -35,15 +37,20 @@ You need to install and enable the Docker service. - `load` - Loads the Docker image `rserve` available in this repository. +- `remove` + - Removes the current image. + - `run` - Starts the Rserve container. This creates a Unix domain socket `/home/rserve/socket` that allows contacting the R server. -- `shell` - - Starts the container with a shell, so you can look around +- `stop` + - Stops and removes the current container. ## License Copyright (c) 2017, Franco Masotti. 2-Clause BSD (aka FreeBSD). + +