add container image
when running monero in a kubernetes cluster, it's quite useful to be able to quickly bring up via a job or any other runner `monero demon *` commands. Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
This commit is contained in:
parent
c0cee1b176
commit
aefba5ec1e
7
.images.lock.yaml
Normal file
7
.images.lock.yaml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
apiVersion: kbld.k14s.io/v1alpha1
|
||||||
|
kind: Config
|
||||||
|
minimumRequiredVersion: 0.30.0
|
||||||
|
overrides:
|
||||||
|
- image: go-monero
|
||||||
|
newImage: index.docker.io/utxobr/go-monero@sha256:195b49c96e8484a2381c069385d8340710454ad060c25c9c3976d79bed33750c
|
||||||
|
preresolved: true
|
13
.images.yaml
Normal file
13
.images.yaml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
---
|
||||||
|
apiVersion: kbld.k14s.io/v1alpha1
|
||||||
|
kind: Config
|
||||||
|
sources:
|
||||||
|
- image: go-monero
|
||||||
|
path: ./
|
||||||
|
destinations:
|
||||||
|
- image: go-monero
|
||||||
|
newImage: docker.io/utxobr/go-monero
|
||||||
|
|
||||||
|
---
|
||||||
|
images:
|
||||||
|
- image: go-monero
|
29
Dockerfile
Normal file
29
Dockerfile
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
ARG BUILDER_IMAGE=golang@sha256:4544ae57fc735d7e415603d194d9fb09589b8ad7acd4d66e928eabfb1ed85ff1
|
||||||
|
ARG RUNTIME_IMAGE=gcr.io/distroless/static@sha256:c9f9b040044cc23e1088772814532d90adadfa1b86dcba17d07cb567db18dc4e
|
||||||
|
|
||||||
|
|
||||||
|
FROM $BUILDER_IMAGE as builder
|
||||||
|
|
||||||
|
WORKDIR /workspace
|
||||||
|
|
||||||
|
COPY .git .git
|
||||||
|
COPY go.mod go.mod
|
||||||
|
COPY go.sum go.sum
|
||||||
|
COPY pkg/ pkg/
|
||||||
|
COPY cmd/ cmd/
|
||||||
|
|
||||||
|
RUN set -x && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on \
|
||||||
|
go build -a -v \
|
||||||
|
-trimpath \
|
||||||
|
-tags osusergo,netgo,static_build \
|
||||||
|
-o monero \
|
||||||
|
./cmd/monero
|
||||||
|
|
||||||
|
|
||||||
|
FROM $RUNTIME_IMAGE
|
||||||
|
|
||||||
|
WORKDIR /
|
||||||
|
COPY --chown=nonroot:nonroot --from=builder /workspace/monero .
|
||||||
|
USER nonroot:nonroot
|
||||||
|
|
||||||
|
ENTRYPOINT ["/monero"]
|
4
Makefile
4
Makefile
|
@ -9,3 +9,7 @@ test:
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
go run github.com/golangci/golangci-lint/cmd/golangci-lint run --config=.golangci.yaml
|
go run github.com/golangci/golangci-lint/cmd/golangci-lint run --config=.golangci.yaml
|
||||||
|
|
||||||
|
.images.lock.yaml: .images.yaml
|
||||||
|
kbld -f $< --lock-output $@
|
||||||
|
.PHONY: .images.lock.yaml
|
||||||
|
|
Reference in a new issue