Skip to content

Commit

Permalink
Add Dockerfiles
Browse files Browse the repository at this point in the history
bug #48
  • Loading branch information
stevemcquaid authored and cernekee committed Sep 12, 2018
1 parent c948387 commit 6624457
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 0 deletions.
25 changes: 25 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
26 changes: 26 additions & 0 deletions docker/Makefile
Original file line number Diff line number Diff line change
@@ -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"
4 changes: 4 additions & 0 deletions docker/scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -ex

docker build -t stevemcquaid/stoken:latest .
4 changes: 4 additions & 0 deletions docker/scripts/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

docker run --interactive --tty --volume $HOME:/root \
stevemcquaid/stoken:latest stoken $@

0 comments on commit 6624457

Please sign in to comment.