Skip to content

Commit

Permalink
Created goals for running dockerized skywire-node:
Browse files Browse the repository at this point in the history
- `make node` - will create and start dockerized `skywire-node`
- `make refresh-node` - stops containerized `skywire-node`, copies `skywire-node` binary and
starts dockerized `skywire-node` again

Docker creation can be customized with:

DOCKER_IMAGE=buildpack-deps:stretch-scm # docker image to use for running skywire-node. `golang` is OK too
DOCKER_NETWORK=SKYNET
DOCKER_NODE=SKY01
  • Loading branch information
ayuryshev committed Mar 14, 2019
1 parent 6f7aa96 commit 99bd30a
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ pkg/node/foo/
/skywire-cli
/manager-node
/therealssh-cli
/node
35 changes: 34 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
OPTS=GO111MODULE=on
OPTS=GO111MODULE=on
DOCKER_IMAGE=buildpack-deps:stretch-scm # docker image to use for running skywire-node. `golang` is OK too
DOCKER_NETWORK=SKYNET
DOCKER_NODE=SKY01


build: dep apps bin

Expand Down Expand Up @@ -72,3 +76,32 @@ manager-node:

therealssh-cli:
${OPTS} go build -o ./therealssh-cli ./cmd/therealssh-cli

# Node

docker-clean:
-docker network rm ${DOCKER_NETWORK}
-docker container rm --force ${DOCKER_NODE}

docker-network:
-docker network create ${DOCKER_NETWORK}

docker-volume: build
mkdir -p ./node
cp ./skywire-node ./node
cp -r ./apps ./node/apps
./skywire-cli config ./node/skywire.json
cat ./node/skywire.json|grep static_public_key |cut -d ':' -f2 |tr -d '"'','' ' > ./node/PK

node: docker-clean docker-network docker-volume
docker run -d -v $(shell pwd)/node:/sky --network=${DOCKER_NETWORK} --name=${DOCKER_NODE} ${DOCKER_IMAGE} bash -c "cd /sky && ./skywire-node"

run:
./skywire-node

node-stop:
-docker container stop ${DOCKER_NODE}

refresh-node: node-stop
cp ./skywire-node ./node
docker container start ${DOCKER_NODE}

0 comments on commit 99bd30a

Please sign in to comment.