Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
d1ece2e4e6 | |||
c20e1a36b3 | |||
2f50ab66ee | |||
70a8330d64 | |||
0d332b2f05 | |||
0791c6afa3 |
12
.drone.yml
12
.drone.yml
@ -1,14 +1,10 @@
|
||||
kind: pipeline
|
||||
name: test
|
||||
|
||||
workspace:
|
||||
base: /go/src/dockron
|
||||
|
||||
steps:
|
||||
- name: build
|
||||
image: golang:1.11
|
||||
image: golang:1.12
|
||||
commands:
|
||||
- go get -u github.com/golang/dep/cmd/dep
|
||||
- make build
|
||||
|
||||
---
|
||||
@ -26,14 +22,10 @@ trigger:
|
||||
- refs/heads/master
|
||||
- refs/tags/v*
|
||||
|
||||
workspace:
|
||||
base: /go/src/dockron
|
||||
|
||||
steps:
|
||||
- name: build
|
||||
image: golang:1.11
|
||||
image: golang:1.12
|
||||
commands:
|
||||
- go get -u github.com/golang/dep/cmd/dep
|
||||
- make build-all-static
|
||||
|
||||
- name: push image - arm
|
||||
|
15
Dockerfile
15
Dockerfile
@ -1,20 +1,7 @@
|
||||
ARG REPO=library
|
||||
# FROM golang:1.11-alpine AS builder
|
||||
#
|
||||
# RUN apk add --no-cache git
|
||||
# RUN go get -u github.com/golang/dep/cmd/dep
|
||||
#
|
||||
# WORKDIR /go/src/app/
|
||||
# COPY ./Gopkg.* /go/src/app/
|
||||
# RUN dep ensure --vendor-only
|
||||
#
|
||||
# COPY ./main.go /go/src/app/
|
||||
#
|
||||
# RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -a -installsuffix nocgo -o dockron .
|
||||
|
||||
FROM ${REPO}/busybox:latest
|
||||
WORKDIR /root/
|
||||
# COPY --from=builder /go/src/app/dockron .
|
||||
|
||||
ARG ARCH=amd64
|
||||
COPY ./dockron-linux-${ARCH} ./dockron
|
||||
|
||||
|
19
Dockerfile.multi-stage
Normal file
19
Dockerfile.multi-stage
Normal file
@ -0,0 +1,19 @@
|
||||
ARG REPO=library
|
||||
FROM ${REPO}/golang:1.12-alpine AS builder
|
||||
|
||||
RUN apk add --no-cache git
|
||||
|
||||
RUN mkdir /app
|
||||
WORKDIR /app
|
||||
|
||||
COPY ./go.mod ./go.sum /app/
|
||||
RUN go mod download
|
||||
|
||||
COPY ./main.go /app/
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -a -installsuffix nocgo -o dockron .
|
||||
|
||||
FROM ${REPO}/busybox:latest
|
||||
WORKDIR /root/
|
||||
COPY --from=builder /app/dockron .
|
||||
|
||||
CMD [ "./dockron" ]
|
20
Makefile
20
Makefile
@ -5,28 +5,28 @@ default: build
|
||||
|
||||
# Downloads dependencies into vendor directory
|
||||
vendor:
|
||||
dep ensure
|
||||
go mod vendor
|
||||
|
||||
# Runs the application, useful while developing
|
||||
.PHONY: run
|
||||
run: vendor
|
||||
run:
|
||||
go run *.go
|
||||
|
||||
# Output target
|
||||
dockron: vendor
|
||||
dockron:
|
||||
go build -o dockron
|
||||
|
||||
# Alias for building
|
||||
.PHONY: build
|
||||
build: dockron
|
||||
|
||||
dockron-linux-amd64: vendor
|
||||
dockron-linux-amd64:
|
||||
GOARCH=amd64 CGO_ENABLED=0 GOOS=linux go build -a -installsuffix nocgo -o dockron-linux-amd64
|
||||
|
||||
dockron-linux-arm: vendor
|
||||
dockron-linux-arm:
|
||||
GOARCH=arm CGO_ENABLED=0 GOOS=linux go build -a -installsuffix nocgo -o dockron-linux-arm
|
||||
|
||||
dockron-linux-arm64: vendor
|
||||
dockron-linux-arm64:
|
||||
GOARCH=arm64 CGO_ENABLED=0 GOOS=linux go build -a -installsuffix nocgo -o dockron-linux-arm64
|
||||
|
||||
.PHONY: build-all-static
|
||||
@ -35,18 +35,14 @@ build-all-static: dockron-linux-amd64 dockron-linux-arm dockron-linux-arm64
|
||||
# Cleans all build artifacts
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm dockron
|
||||
rm -f dockron
|
||||
rm -f dockron-linux-*
|
||||
|
||||
# Cleans vendor directory
|
||||
.PHONY: clean-vendor
|
||||
clean-vendor:
|
||||
rm -fr ./vendor
|
||||
|
||||
# Attempts to update dependencies
|
||||
.PHONY: dep-update
|
||||
dep-update:
|
||||
dep ensure -update
|
||||
|
||||
.PHONY: docker-build
|
||||
docker-build:
|
||||
docker build . -t ${DOCKER_TAG}-linux-amd64
|
||||
|
15
go.mod
Normal file
15
go.mod
Normal file
@ -0,0 +1,15 @@
|
||||
module github.com/iamthefij/dockron
|
||||
|
||||
go 1.12
|
||||
|
||||
require (
|
||||
github.com/Microsoft/go-winio v0.4.9 // indirect
|
||||
github.com/docker/distribution v2.6.2+incompatible // indirect
|
||||
github.com/docker/docker v1.13.1
|
||||
github.com/docker/go-connections v0.4.0 // indirect
|
||||
github.com/docker/go-units v0.3.3 // indirect
|
||||
github.com/pkg/errors v0.8.0 // indirect
|
||||
github.com/robfig/cron v1.1.0
|
||||
golang.org/x/net v0.0.0-20180801234040-f4c29de78a2a
|
||||
golang.org/x/sys v0.0.0-20180802203216-0ffbfd41fbef // indirect
|
||||
)
|
18
go.sum
Normal file
18
go.sum
Normal file
@ -0,0 +1,18 @@
|
||||
github.com/Microsoft/go-winio v0.4.9 h1:3RbgqgGVqmcpbOiwrjbVtDHLlJBGF6aE+yHmNtBNsFQ=
|
||||
github.com/Microsoft/go-winio v0.4.9/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA=
|
||||
github.com/docker/distribution v2.6.2+incompatible h1:4FI6af79dfCS/CYb+RRtkSHw3q1L/bnDjG1PcPZtQhM=
|
||||
github.com/docker/distribution v2.6.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
||||
github.com/docker/docker v1.13.1 h1:IkZjBSIc8hBjLpqeAbeE5mca5mNgeatLHBy3GO78BWo=
|
||||
github.com/docker/docker v1.13.1/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
|
||||
github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=
|
||||
github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
|
||||
github.com/docker/go-units v0.3.3 h1:Xk8S3Xj5sLGlG5g67hJmYMmUgXv5N4PhkjJHHqrwnTk=
|
||||
github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
|
||||
github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw=
|
||||
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/robfig/cron v1.1.0 h1:jk4/Hud3TTdcrJgUOBgsqrZBarcxl6ADIjSC2iniwLY=
|
||||
github.com/robfig/cron v1.1.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k=
|
||||
golang.org/x/net v0.0.0-20180801234040-f4c29de78a2a h1:8fCF9zjAir2SP3N+axz9xs+0r4V8dqPzqsWO10t8zoo=
|
||||
golang.org/x/net v0.0.0-20180801234040-f4c29de78a2a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/sys v0.0.0-20180802203216-0ffbfd41fbef h1:ESfhYoBNk2UQGmavscFPKfwmc4ZTB2+UdQYsVw6Bq9M=
|
||||
golang.org/x/sys v0.0.0-20180802203216-0ffbfd41fbef/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
Loading…
Reference in New Issue
Block a user