feat(oci): Use Buildah
And set version the right way...
This commit is contained in:
@@ -1,15 +1,26 @@
|
||||
ARG GOVERSION=1.24
|
||||
|
||||
FROM docker.io/golang:${GOVERSION} AS builder
|
||||
ARG VERSION=master
|
||||
ARG VERSION
|
||||
RUN \
|
||||
if [ "${VERSION}" = "" ]; then\
|
||||
echo "You must set VERSION build argument"; \
|
||||
exit 1; \
|
||||
fi
|
||||
COPY go.mod go.sum /go/src/github.com/katenary/katenary/
|
||||
COPY cmd /go/src/github.com/katenary/katenary/cmd
|
||||
COPY internal /go/src/github.com/katenary/katenary/internal
|
||||
WORKDIR /go/src/github.com/katenary/katenary
|
||||
ENV CGO_ENABLED=0
|
||||
RUN set -xe; \
|
||||
CGO_ENABLED=0 go install -v github.com/katenary/katenary/cmd/katenary@$VERSION;
|
||||
go build -ldflags="-X 'github.com/katenary/katenary/internal/generator.Version=v${VERSION}'" -trimpath -o katenary ./cmd/katenary
|
||||
|
||||
|
||||
FROM scratch
|
||||
LABEL org.opencontainers.image.source=https://github.com/katenary/katenary
|
||||
LABEL org.opencontainers.image.description="Katenary converts compose files to Helm Chart"
|
||||
LABEL org.opencontainers.image.licenses=MIT
|
||||
COPY --from=builder /go/bin/katenary /usr/local/bin/katenary
|
||||
COPY --from=builder /go/src/github.com/katenary/katenary/katenary /usr/local/bin/katenary
|
||||
VOLUME /project
|
||||
WORKDIR /project
|
||||
ENTRYPOINT ["/usr/local/bin/katenary"]
|
||||
|
Reference in New Issue
Block a user