forked from maoe/viewprof
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mitsutoshi Aoe
committed
Feb 15, 2017
1 parent
3bb3f24
commit 93f3044
Showing
3 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM alpine:latest | ||
|
||
RUN echo "@testing http://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \ | ||
&& apk update \ | ||
&& apk upgrade \ | ||
&& apk add \ | ||
curl \ | ||
ghc@testing \ | ||
git \ | ||
musl-dev \ | ||
ncurses-dev \ | ||
&& curl -sSL https://get.haskellstack.org/ | sh 2>&1 \ | ||
&& adduser -S viewprof | ||
|
||
USER viewprof | ||
ENV PATH="/home/viewprof/.local/bin:$PATH" | ||
WORKDIR /home/viewprof | ||
|
||
RUN stack config set system-ghc --global true 2>&1 \ | ||
&& stack install viewprof 2>&1 | ||
|
||
ENTRYPOINT ["viewprof"] | ||
CMD ["--help"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
|
||
DOCKER_DIR=$(realpath $(dirname "$0")) | ||
|
||
docker build -f "$DOCKER_DIR/Dockerfile" -t viewprof . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
|
||
if [ -n "$1" ]; then | ||
PROF_FILE=$(realpath "$1") | ||
PROF_NAME=$(basename "$PROF_FILE") | ||
fi | ||
|
||
if [ -n "$PROF_FILE" -a -n "$PROF_NAME" ]; then | ||
docker run --rm -it -v "$PROF_FILE:/home/viewprof/$PROF_NAME" viewprof "/home/viewprof/$PROF_NAME" | ||
else | ||
docker run --rm -it viewprof | ||
fi |