Skip to content

Commit

Permalink
added dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
ivcosla committed Jul 4, 2019
1 parent 6adc363 commit 8f8975b
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 0 deletions.
25 changes: 25 additions & 0 deletions docker/images/builder/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
ARG base=golang:alpine

FROM ${base} as devenv

ARG CGO_ENABLED=0
ENV CGO_ENABLED=${CGO_ENABLED} \
GOOS=linux \
GOARCH=amd64 \
GO111MODULE=on

COPY . skywire
WORKDIR skywire

RUN ./docker/images/builder/update.sh
RUN ./docker/images/builder/install.sh
RUN apk add make

RUN go build -mod=vendor -tags netgo -ldflags="-w -s" \
-o skywire-node cmd/skywire-node/skywire-node.go &&\
go build -mod=vendor -ldflags="-w -s" -o ./apps/skychat.v1.0 ./cmd/apps/skychat &&\
go build -mod=vendor -ldflags="-w -s" -o ./apps/helloworld.v1.0 ./cmd/apps/helloworld &&\
go build -mod=vendor -ldflags="-w -s" -o ./apps/socksproxy.v1.0 ./cmd/apps/therealproxy &&\
go build -mod=vendor -ldflags="-w -s" -o ./apps/socksproxy-client.v1.0 ./cmd/apps/therealproxy-client &&\
go build -mod=vendor -ldflags="-w -s" -o ./apps/SSH.v1.0 ./cmd/apps/therealssh &&\
go build -mod=vendor -ldflags="-w -s" -o ./apps/SSH-client.v1.0 ./cmd/apps/therealssh-client
13 changes: 13 additions & 0 deletions docker/images/builder/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

if type apt > /dev/null; then
apt update
apt upgrade -y
apt install -y ca-certificates iproute2 iputils-ping redis-server supervisor

# rm -rf /var/lib/apt/lists/*
fi

if type apk > /dev/null; then
apk add --no-cache redis supervisor
fi
15 changes: 15 additions & 0 deletions docker/images/builder/update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

if type apt > /dev/null; then
apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
fi

if type apk > /dev/null; then

apk update
apk upgrade
apk add --no-cache ca-certificates openssl
update-ca-certificates --fresh
fi
12 changes: 12 additions & 0 deletions docker/images/node/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ARG builder=node-builder
ARG base=alpine

FROM ${builder} as builder

FROM ${base} as base

COPY --from=builder /go/skywire/skywire-node skywire-node
COPY --from=builder /go/skywire/apps bin/apps
COPY --from=builder /go/skywire/docker/images/builder/update.sh update.sh

ENTRYPOINT [ "./skywire-node" ]

0 comments on commit 8f8975b

Please sign in to comment.