Skip to content

Commit

Permalink
Code package dependencies are managed using the GO Module.Update Dock…
Browse files Browse the repository at this point in the history
…erfile
  • Loading branch information
evildecay committed Sep 11, 2019
1 parent aabde17 commit ebadd8a
Show file tree
Hide file tree
Showing 6 changed files with 261 additions and 104 deletions.
28 changes: 14 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
FROM golang:1.9-alpine as builder
FROM golang:1.12 as build

RUN apk add -U git \
&& go get github.com/golang/dep/...
ENV GO111MODULE on
ENV GOPROXY "https://goproxy.io"

WORKDIR /go/src/github.com/evildecay/etcdkeeper
WORKDIR /opt
RUN mkdir etcdkeeper
ADD . /opt/etcdkeeper
WORKDIR /opt/etcdkeeper/src/etcdkeeper

ADD src ./
ADD Gopkg.* ./
RUN go mod download \
&& go build -o etcdkeeper.bin main.go

RUN dep ensure -update \
&& go build -o etcdkeeper.bin etcdkeeper/main.go


FROM alpine:3.7
FROM alpine:3.10

ENV HOST="0.0.0.0"
ENV PORT="8080"

RUN apk add --no-cache ca-certificates
# RUN apk add --no-cache ca-certificates

RUN apk add --no-cache ca-certificates
RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2

WORKDIR /etcdkeeper
COPY --from=builder /go/src/github.com/evildecay/etcdkeeper/etcdkeeper.bin .
WORKDIR /opt/etcdkeeper
COPY --from=build /opt/etcdkeeper/src/etcdkeeper/etcdkeeper.bin .
ADD assets assets

EXPOSE ${PORT}
Expand Down
45 changes: 0 additions & 45 deletions Gopkg.lock

This file was deleted.

22 changes: 0 additions & 22 deletions Gopkg.toml

This file was deleted.

49 changes: 26 additions & 23 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
version: '3.5'
# Just as an example, not as a formally deployed configuration.
# Because the actual production may deploy the etcd cluster, there is no cluster related to etcd.

services:
etcd:
image: "quay.io/coreos/etcd:v3.3"
container_name: "etcd"
environment:
ETCD_ADVERTISE_CLIENT_URLS: "http://0.0.0.0:2379"
ETCD_LISTEN_CLIENT_URLS: "http://0.0.0.0:2379"
ETCDCTL_API: "2"
ports:
- 2379:2379
- 2380:2380
- 4001:4001

etcdkeeper:
build: .
container_name: "etcdkeeper"
environment:
HOST: "0.0.0.0"
ports:
- 12000:8080
depends_on:
- etcd
#version: '1.0'
#
#services:
# etcd:
# image: "quay.io/coreos/etcd:v3.3"
# container_name: "etcd"
# environment:
# ETCD_ADVERTISE_CLIENT_URLS: "http://0.0.0.0:2379"
# ETCD_LISTEN_CLIENT_URLS: "http://0.0.0.0:2379"
# ETCDCTL_API: "2"
# ports:
# - 2379:2379
# - 2380:2380
# - 4001:4001
#
# etcdkeeper:
# build: .
# container_name: "etcdkeeper"
# environment:
# HOST: "0.0.0.0"
# ports:
# - 12000:8080
# depends_on:
# - etcd
39 changes: 39 additions & 0 deletions src/etcdkeeper/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
module etcdkeeper

go 1.12

require (
github.com/coreos/bbolt v1.3.3 // indirect
github.com/coreos/etcd v3.3.15+incompatible
github.com/coreos/go-semver v0.3.0 // indirect
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f // indirect
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect
github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
github.com/gogo/protobuf v1.3.0 // indirect
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 // indirect
github.com/google/btree v1.0.0 // indirect
github.com/google/uuid v1.1.1 // indirect
github.com/gorilla/websocket v1.4.1 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.11.1 // indirect
github.com/jonboulle/clockwork v0.1.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/prometheus/client_golang v1.1.0 // indirect
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 // indirect
github.com/soheilhy/cmux v0.1.4 // indirect
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 // indirect
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 // indirect
go.etcd.io/bbolt v1.3.3 // indirect
go.uber.org/atomic v1.4.0 // indirect
go.uber.org/multierr v1.1.0 // indirect
go.uber.org/zap v1.10.0 // indirect
golang.org/x/crypto v0.0.0-20190907121410-71b5226ff739 // indirect
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 // indirect
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect
google.golang.org/appengine v1.4.0 // indirect
google.golang.org/genproto v0.0.0-20190905072037-92dd089d5514 // indirect
google.golang.org/grpc v1.23.0 // indirect
sigs.k8s.io/yaml v1.1.0 // indirect
)
Loading

0 comments on commit ebadd8a

Please sign in to comment.