zmq and refactor

This commit is contained in:
dave 2021-05-20 18:07:24 -07:00
parent 6e53f75326
commit 54faf24046
6 changed files with 252 additions and 116 deletions

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
/swarm

View File

@ -1,3 +1,25 @@
FROM scratch
COPY swarm /
FROM ubuntu:bionic AS builder
RUN set -x && \
apt-get update && \
apt-get install -y wget libczmq4 libczmq-dev libsodium-dev libsodium23 pkg-config && \
wget -qO- https://golang.org/dl/go1.16.4.linux-amd64.tar.gz | tar -C /usr/local -xzf- && \
rm -vrf /var/lib/apt/lists/*
ADD . /tmp/code
RUN export PATH=$PATH:/usr/local/go/bin && \
cd /tmp/code && \
go build -o swarm cmd/swarm/main.go
FROM ubuntu:bionic
RUN set -x && \
apt-get update && \
apt-get install -y libczmq4 libsodium23 && \
rm -vrf /var/lib/apt/lists/*
COPY --from=builder /tmp/code/swarm /swarm
USER nobody
ENTRYPOINT ["/swarm"]

View File

@ -1,4 +1,6 @@
BUILDVARS := CGO_ENABLED=0
BUILDVARS :=
#CGO_ENABLED=0
TAG := latest
.PHONY: swarm
swarm:
@ -13,9 +15,9 @@ clean:
rm -vf swarm
.PHONY: image
image: linux
docker build -t dockermirror:5000/dpedu/antiroachswarm .
image:
docker build -t dockermirror:5000/dpedu/antiroachswarm:$(TAG) .
.PHONY: push
push: image
docker push dockermirror:5000/dpedu/antiroachswarm
docker push dockermirror:5000/dpedu/antiroachswarm:$(TAG)

File diff suppressed because one or more lines are too long

1
go.mod
View File

@ -5,4 +5,5 @@ go 1.16
require (
golang.org/x/net v0.0.0-20210510120150-4163338589ed
gopkg.in/irc.v3 v3.1.4
gopkg.in/zeromq/goczmq.v4 v4.1.0
)

2
go.sum
View File

@ -18,3 +18,5 @@ gopkg.in/irc.v3 v3.1.4/go.mod h1:shO2gz8+PVeS+4E6GAny88Z0YVVQSxQghdrMVGQsR9s=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/zeromq/goczmq.v4 v4.1.0 h1:CE+FE81mGVs2aSlnbfLuS1oAwdcVywyMM2AC1g33imI=
gopkg.in/zeromq/goczmq.v4 v4.1.0/go.mod h1:h4IlfePEYMpFdywGr5gAwKhBBj+hiBl/nF4VoSE4k+0=