diff options
author | Mike Crute <mike@crute.us> | 2017-11-11 19:59:32 +0000 |
---|---|---|
committer | Mike Crute <mike@crute.us> | 2017-11-11 19:59:32 +0000 |
commit | 2073a7c684765ff3184c34ea7d0960118d7e3c74 (patch) | |
tree | 3ad53dea2368adfaa122008fd23989be933b6a4b /newsboat | |
parent | 54c56da736241a56db6a3200aea454b66ed006f1 (diff) | |
download | dockerfiles-2073a7c684765ff3184c34ea7d0960118d7e3c74.tar.bz2 dockerfiles-2073a7c684765ff3184c34ea7d0960118d7e3c74.tar.xz dockerfiles-2073a7c684765ff3184c34ea7d0960118d7e3c74.zip |
Add newsboat
Diffstat (limited to 'newsboat')
-rw-r--r-- | newsboat/Dockerfile | 38 | ||||
-rw-r--r-- | newsboat/Makefile | 15 | ||||
-rwxr-xr-x | newsboat/entrypoint.sh | 35 |
3 files changed, 88 insertions, 0 deletions
diff --git a/newsboat/Dockerfile b/newsboat/Dockerfile new file mode 100644 index 0000000..82f62b0 --- /dev/null +++ b/newsboat/Dockerfile | |||
@@ -0,0 +1,38 @@ | |||
1 | FROM alpine:latest | ||
2 | LABEL maintainer="Mike Crute <mike@crute.us>" | ||
3 | |||
4 | RUN \ | ||
5 | apk add --no-cache --virtual .build-deps \ | ||
6 | asciidoc \ | ||
7 | build-base \ | ||
8 | curl-dev \ | ||
9 | gettext-dev \ | ||
10 | git \ | ||
11 | json-c-dev \ | ||
12 | libxml2-dev \ | ||
13 | ncurses-dev \ | ||
14 | libressl-dev \ | ||
15 | sqlite-dev \ | ||
16 | stfl-dev \ | ||
17 | && cd /tmp \ | ||
18 | && git clone git://github.com/newsboat/newsboat.git /tmp/newsboat \ | ||
19 | && cd newsboat \ | ||
20 | && sed -Ei 's/^([^_]+_LIBS=.*)/\1 -lintl/' Makefile \ | ||
21 | && make \ | ||
22 | && make install \ | ||
23 | && apk del .build-deps \ | ||
24 | && apk add --no-cache \ | ||
25 | gettext \ | ||
26 | json-c \ | ||
27 | libcurl \ | ||
28 | libintl \ | ||
29 | libstdc++ \ | ||
30 | libxml2 \ | ||
31 | ncurses-libs \ | ||
32 | sqlite-libs \ | ||
33 | stfl \ | ||
34 | su-exec \ | ||
35 | && rm -rf /tmp/* | ||
36 | |||
37 | ADD entrypoint.sh / | ||
38 | ENTRYPOINT [ "/entrypoint.sh" ] | ||
diff --git a/newsboat/Makefile b/newsboat/Makefile new file mode 100644 index 0000000..0672af4 --- /dev/null +++ b/newsboat/Makefile | |||
@@ -0,0 +1,15 @@ | |||
1 | REPO=575365190010.dkr.ecr.us-west-2.amazonaws.com | ||
2 | VERSION=dev | ||
3 | IMAGE=newsboat:$(VERSION)-alpine | ||
4 | |||
5 | all: | ||
6 | docker build -t $(IMAGE) . | ||
7 | |||
8 | all-no-cache: | ||
9 | docker build --no-cache -t $(IMAGE) . | ||
10 | |||
11 | run: | ||
12 | docker run -ti --detach-keys ctrl-@ $(IMAGE) | ||
13 | |||
14 | publish: | ||
15 | eval $$(aws ecr get-login --region us-west-2) | ||
diff --git a/newsboat/entrypoint.sh b/newsboat/entrypoint.sh new file mode 100755 index 0000000..f0e4994 --- /dev/null +++ b/newsboat/entrypoint.sh | |||
@@ -0,0 +1,35 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | HOME_DIR="/home/newsboat/.newsboat" | ||
4 | URLS_FILE="${HOME_DIR}/urls" | ||
5 | |||
6 | # No point starting if they don't have config, also we don't | ||
7 | # want to store the actual user data in the container so force | ||
8 | # a mount. | ||
9 | if [ ! -d $HOME_DIR ]; then | ||
10 | echo "Mount your newsboat config to /home/newsboat/.newsboat" | ||
11 | exit 1 | ||
12 | fi | ||
13 | |||
14 | # Also force a urls file because this newsboat will just fail | ||
15 | # anyhow without it. | ||
16 | if [ ! -f $URLS_FILE ]; then | ||
17 | echo "Create a urls file in your newsboat config first" | ||
18 | exit 1 | ||
19 | fi | ||
20 | |||
21 | # Allow users to specify the UID/GID in the environment but | ||
22 | # default these to the existing owner of the files in their | ||
23 | # mounted config, which should be sane. | ||
24 | UID=${UID:-$(stat -c "%u" $URLS_FILE)} | ||
25 | GID=${GID:-$(stat -c "%u" $URLS_FILE)} | ||
26 | |||
27 | # Create the user and group | ||
28 | addgroup -g ${GID} -S newsboat | ||
29 | adduser -u ${UID} -S -h /home/newsboat -H -D -G newsboat newsboat | ||
30 | |||
31 | if [ "$1" == "/bin/sh" ]; then | ||
32 | /sbin/su-exec newsboat "$@" | ||
33 | else | ||
34 | /sbin/su-exec newsboat /usr/local/bin/newsboat | ||
35 | fi | ||