Skip to content

Commit 933a630

Browse files
authored
Merge pull request #6 from arturgontijo/_new_daemon
[Dockerfile] Get latest Daemon on build.
2 parents e2daffb + 15fce1a commit 933a630

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

Dockerfile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
11
FROM ubuntu:18.04
22

3-
ARG snetd_version="v0.1.7"
4-
53
ENV SINGNET_REPOS=/opt/singnet
64

75
RUN mkdir -p ${SINGNET_REPOS}
86

97
RUN apt-get update && \
108
apt-get install -y \
9+
curl \
1110
nano \
1211
git \
1312
wget
1413

1514
RUN apt-get install -y python3 python3-pip
1615

17-
RUN cd ${SINGNET_REPOS} && \
18-
mkdir snet-daemon && \
19-
cd snet-daemon && \
20-
wget https://github.com/singnet/snet-daemon/releases/download/${snetd_version}/snet-daemon-${snetd_version}-linux-amd64.tar.gz && \
21-
tar -xvf snet-daemon-${snetd_version}-linux-amd64.tar.gz && \
22-
mv snet-daemon-${snetd_version}-linux-amd64/snetd /usr/bin/snetd
16+
RUN SNETD_VERSION=`curl -s https://api.github.com/repos/singnet/snet-daemon/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")'` && \
17+
cd /tmp && \
18+
wget https://github.com/singnet/snet-daemon/releases/download/${SNETD_VERSION}/snet-daemon-${SNETD_VERSION}-linux-amd64.tar.gz && \
19+
tar -xvf snet-daemon-${SNETD_VERSION}-linux-amd64.tar.gz && \
20+
mv snet-daemon-${SNETD_VERSION}-linux-amd64/snetd /usr/bin/snetd
2321

2422
RUN cd ${SINGNET_REPOS} && \
2523
git clone https://github.com/singnet/example-service.git && \

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,10 @@ python3 run_example_service.py
102102

103103
##### Running Service + Daemon in Docker Container
104104

105-
* Build the docker image (with proper `SNET Daemon` version) and run a Container from it:
105+
* Build the docker image and run a container from it:
106106

107107
```
108-
SNETD_VERSION="v0.1.7"
109108
docker build \
110-
--build-arg snetd_version=$SNETD_VERSION \
111109
-t snet_example_service \
112110
https://github.com/singnet/example-service.git#master
113111

0 commit comments

Comments
 (0)