From 6624457bc26ce15276835743c6e5c2c8a284c6fe Mon Sep 17 00:00:00 2001 From: Steve McQuaid Date: Thu, 7 Jun 2018 13:33:40 -0500 Subject: [PATCH] Add Dockerfiles bug #48 --- docker/Dockerfile | 25 +++++++++++++++++++++++++ docker/Makefile | 26 ++++++++++++++++++++++++++ docker/scripts/build.sh | 4 ++++ docker/scripts/run.sh | 4 ++++ 4 files changed, 59 insertions(+) create mode 100644 docker/Dockerfile create mode 100755 docker/Makefile create mode 100755 docker/scripts/build.sh create mode 100755 docker/scripts/run.sh diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..02d580f --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,25 @@ +FROM ubuntu:16.04 + +RUN apt-get update +RUN apt-get install -y \ + libgtk-3-dev \ + libtomcrypt-dev \ + libxml2-dev \ + autoconf \ + automake \ + libtool \ + build-essential \ + git + +RUN git clone git://github.com/cernekee/stoken + +WORKDIR stoken + +RUN bash autogen.sh && \ + ./configure && \ + make && \ + make check && \ + make install && \ + ldconfig + +CMD stoken diff --git a/docker/Makefile b/docker/Makefile new file mode 100755 index 0000000..a5e65b6 --- /dev/null +++ b/docker/Makefile @@ -0,0 +1,26 @@ +## Build container +build: + @bash -x scripts/build.sh + +## Push container +push: + @bash -x scripts/push.sh + +## Run project +run: + @bash -x scripts/run.sh + +help: + @printf "Available targets:\n\n" + @awk '/^[a-zA-Z\-\_0-9%:\\]+:/ { \ + helpMessage = match(lastLine, /^## (.*)/); \ + if (helpMessage) { \ + helpCommand = $$1; \ + helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \ + gsub("\\\\", "", helpCommand); \ + gsub(":+$$", "", helpCommand); \ + printf " \x1b[32;01m%-35s\x1b[0m %s\n", helpCommand, helpMessage; \ + } \ + } \ + { lastLine = $$0 }' $(MAKEFILE_LIST) | sort -u + @printf "\n" \ No newline at end of file diff --git a/docker/scripts/build.sh b/docker/scripts/build.sh new file mode 100755 index 0000000..3a2b2c6 --- /dev/null +++ b/docker/scripts/build.sh @@ -0,0 +1,4 @@ +#!/bin/bash +set -ex + +docker build -t stevemcquaid/stoken:latest . diff --git a/docker/scripts/run.sh b/docker/scripts/run.sh new file mode 100755 index 0000000..a14ef86 --- /dev/null +++ b/docker/scripts/run.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +docker run --interactive --tty --volume $HOME:/root \ + stevemcquaid/stoken:latest stoken $@