aboutsummaryrefslogtreecommitdiff
path: root/newsboat
diff options
context:
space:
mode:
authorMike Crute <mike@crute.us>2017-11-11 19:59:32 +0000
committerMike Crute <mike@crute.us>2017-11-11 19:59:32 +0000
commit2073a7c684765ff3184c34ea7d0960118d7e3c74 (patch)
tree3ad53dea2368adfaa122008fd23989be933b6a4b /newsboat
parent54c56da736241a56db6a3200aea454b66ed006f1 (diff)
downloaddockerfiles-2073a7c684765ff3184c34ea7d0960118d7e3c74.tar.bz2
dockerfiles-2073a7c684765ff3184c34ea7d0960118d7e3c74.tar.xz
dockerfiles-2073a7c684765ff3184c34ea7d0960118d7e3c74.zip
Add newsboat
Diffstat (limited to 'newsboat')
-rw-r--r--newsboat/Dockerfile38
-rw-r--r--newsboat/Makefile15
-rwxr-xr-xnewsboat/entrypoint.sh35
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 @@
1FROM alpine:latest
2LABEL maintainer="Mike Crute <mike@crute.us>"
3
4RUN \
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
37ADD entrypoint.sh /
38ENTRYPOINT [ "/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 @@
1REPO=575365190010.dkr.ecr.us-west-2.amazonaws.com
2VERSION=dev
3IMAGE=newsboat:$(VERSION)-alpine
4
5all:
6 docker build -t $(IMAGE) .
7
8all-no-cache:
9 docker build --no-cache -t $(IMAGE) .
10
11run:
12 docker run -ti --detach-keys ctrl-@ $(IMAGE)
13
14publish:
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
3HOME_DIR="/home/newsboat/.newsboat"
4URLS_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.
9if [ ! -d $HOME_DIR ]; then
10 echo "Mount your newsboat config to /home/newsboat/.newsboat"
11 exit 1
12fi
13
14# Also force a urls file because this newsboat will just fail
15# anyhow without it.
16if [ ! -f $URLS_FILE ]; then
17 echo "Create a urls file in your newsboat config first"
18 exit 1
19fi
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.
24UID=${UID:-$(stat -c "%u" $URLS_FILE)}
25GID=${GID:-$(stat -c "%u" $URLS_FILE)}
26
27# Create the user and group
28addgroup -g ${GID} -S newsboat
29adduser -u ${UID} -S -h /home/newsboat -H -D -G newsboat newsboat
30
31if [ "$1" == "/bin/sh" ]; then
32 /sbin/su-exec newsboat "$@"
33else
34 /sbin/su-exec newsboat /usr/local/bin/newsboat
35fi