Add Dockerfile to build static binary

Change-Id: Ie7d6945165338cf7c0a7a0ed0e43f33b7d80c518
This commit is contained in:
Mohammed Naser 2020-03-28 18:15:52 -04:00
parent 14d4c3fadf
commit 8c302eaad8
2 changed files with 61 additions and 2 deletions

View File

@ -1,7 +1,58 @@
- secret:
name: smokeping-dockerhub
data:
username: vexxhostzuul
password: !encrypted/pkcs1-oaep
- S+fYF3N4Wj0zKHP1zcERJ5SeVhataWiAOglJRF282k1bZo4GnzXyE7pGqc3cgR5qNYvLz
SpezbcfijWMbmVS2UTcj4q6uMDatfvXONN8yljzJ9Rf+NPp24K1LzRm+UhhQR3WerxFtw
yJ1g+rlhtu9F7oQL6szrGXndqFAOWbSzPt+rI2qYI0GSb5N3iU0i68+L3wlFfopsgeYzk
Ofle2A4aNPombFz6wYORwwpNBiK39YgyZr9hvvl3uenMc1No+f4bD4bO5pUmHM4sUyADL
a9Yj2YX6tWBIYuhvq61UL4DYto1qnfqKYjinznCYZOe5zYSpOY9OuW3607p/6dc16+6oi
prFefhHAGbJIH+fKeCluYk+2yVJcJZcUYYQX0ThFWChx8RaATib0hFgyQpW7yZXQb1kr8
NXX/2drq9oJx++aBHZEWHZrxOlIac5hWvL4k/6s5oG14R6e3UC9SVf+cyOoAjgd3JLUMS
1UsuJyP6JLoKLzXleB10QC6Y10G4zhDa/Gx8uPZ36gOyOcRg2VZvXh9v419wQqtUu+MYe
RPHfxXA+5z8E4LnUFrbMl8uZNYwDLeWBCVbhEQrcWRNZ4bOXenFUPxQTPj4Rt4lJZPnaY
0itJkSoR1WjUDOuFSCbsFQ/CdeS9tre0+bWjJX+KaBTCJP2ejA9y8MXEEq5Hcg=
- job:
name: smokeping_prober:image:build
parent: opendev-build-docker-image
provides: smokeping_prober:image
files: &smokeping_prober_files
- Dockerfile
vars: &smokeping_prober_images
docker_images:
- context: .
repository: vexxhost/smokeping-prober
- job:
name: smokeping_prober:image:upload
parent: opendev-upload-docker-image
provides: smokeping_prober:image
files: *smokeping_prober_files
vars: *smokeping_prober_images
secrets:
- name: docker_credentials
secret: smokeping-dockerhub
pass-to-parent: true
- job:
name: smokeping_prober:image:promote
parent: opendev-promote-docker-image
files: *smokeping_prober_files
vars: *smokeping_prober_images
secrets:
- name: docker_credentials
secret: smokeping-dockerhub
pass-to-parent: true
- project:
check:
jobs:
- noop
- smokeping_prober:image:build
gate:
jobs:
- noop
- smokeping_prober:image:upload
promote:
jobs:
- smokeping_prober:image:promote

8
Dockerfile Normal file
View File

@ -0,0 +1,8 @@
FROM golang:1.13 AS builder
RUN go get github.com/SuperQ/smokeping_prober
RUN cd /go/src/github.com/SuperQ/smokeping_prober && make build
FROM scratch
COPY --from=builder /go/src/github.com/SuperQ/smokeping_prober/smokeping_prober /smokeping_prober
EXPOSE 9374
ENTRYPOINT ["/smokeping_prober"]