Get latest release tagged url from github API

This commit is contained in:
Leopere 2018-11-04 11:32:49 -05:00
parent 6016070ca3
commit 0cc0b2aa13

View file

@ -3,22 +3,24 @@ FROM ubuntu:18.04 as prep
LABEL MAINTAINER="leopere [at] nixc [dot] us" LABEL MAINTAINER="leopere [at] nixc [dot] us"
RUN apt-get update && \ RUN apt-get update && \
apt-get -y install unzip && \ apt-get -y install unzip curl && \
apt-get autoclean -y && \ apt-get autoclean -y && \
rm -rf /var/lib/apt/lists/* && \ rm -rf /var/lib/apt/lists/* && \
mkdir /download mkdir /download && \
curl -o /download/chainquery.zip $(curl -s https://api.github.com/repos/lbryio/chainquery/releases | fgrep 'Linux_x86_64.zip' | grep download | head -n 1 | cut -d'"' -f4)
ADD --chown=1000:1000 https://github.com/lbryio/chainquery/releases/download/v1.1.2/chainquery_1.1.2_Linux_x86_64.zip /download ## I really want to use this instead of all the curl stuff at one point.
# ADD --chown=1000:1000 https://github.com/lbryio/chainquery/releases/download/latest/chainquery_latest_Linux_x86_64.zip /download
RUN cd /download/ && \ RUN cd /download/ && \
unzip chainquery_1.1.2_Linux_x86_64.zip && \ unzip chainquery.zip && \
rm chainquery_1.1.2_Linux_x86_64.zip rm chainquery.zip
## Switch to Alpine eventually we might need to compile in Alpine for this. ## Switch to Alpine eventually we might need to compile in Alpine for this.
FROM ubuntu:18.04 as app FROM ubuntu:18.04 as app
RUN adduser chainquery --gecos GECOS --shell /bin/bash --disabled-password --home /home/chainquery RUN adduser chainquery --gecos GECOS --shell /bin/bash --disabled-password --home /home/chainquery
COPY /download/chainquery /usr/bin
COPY chainqueryconfig.toml /data/chainqueryconfig.toml COPY chainqueryconfig.toml /data/chainqueryconfig.toml
COPY start.sh /usr/local/bin/start COPY start.sh /usr/local/bin/start
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint