zmq and refactor
This commit is contained in:
parent
6e53f75326
commit
54faf24046
|
@ -0,0 +1 @@
|
|||
/swarm
|
26
Dockerfile
26
Dockerfile
|
@ -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"]
|
||||
|
|
10
Makefile
10
Makefile
|
@ -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
1
go.mod
|
@ -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
2
go.sum
|
@ -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=
|
||||
|
|
Loading…
Reference in New Issue