mirror of https://github.com/tgerczei/conteaner
Compare commits
2 Commits
8e68cbcfbf
...
e5740c5a43
Author | SHA1 | Date |
---|---|---|
Tamás Gérczei | e5740c5a43 | |
Tamás Gérczei | 4f08136574 |
23
Dockerfile
23
Dockerfile
|
@ -1,4 +1,4 @@
|
|||
ARG GOVERSION="1.15.2"
|
||||
ARG GOVERSION="1.15.6"
|
||||
|
||||
FROM golang:${GOVERSION}-alpine AS buildenv
|
||||
|
||||
|
@ -10,22 +10,27 @@ ENV TEA_VERSION="${VERSION}"
|
|||
ARG CGO_ENABLED="0"
|
||||
ARG GOOS="linux"
|
||||
|
||||
ARG BUILD_DATE
|
||||
|
||||
WORKDIR $GOPATH/src
|
||||
|
||||
RUN apk add --quiet --no-cache git && \
|
||||
git config --global advice.detachedHead false && \
|
||||
if [ "${TEA_VERSION}" == "development" ]; \
|
||||
then \
|
||||
export TEA_VERSION="development-$(git ls-remote -q ${REPO} HEAD | cut -c-7)"; \
|
||||
else \
|
||||
export BRANCH_MODIFIER="-b v${TEA_VERSION}"; \
|
||||
fi && \
|
||||
git clone --single-branch ${REPO} ${BRANCH_MODIFIER} . && \
|
||||
git clone --single-branch ${REPO} -b v${TEA_VERSION} . && \
|
||||
go get -v . && \
|
||||
go build -v -a -ldflags "-X main.Version=${TEA_VERSION}" -o /tea .
|
||||
|
||||
FROM scratch
|
||||
LABEL maintainer="Tamás Gérczei <tamas@gerczei.eu>"
|
||||
ARG BUILD_DATE
|
||||
ARG VERSION
|
||||
LABEL org.opencontainers.image.title="Gitea - Git with a cup of tea"
|
||||
LABEL org.opencontainers.image.description="A command line tool to interact with Gitea servers"
|
||||
LABEL org.opencontainers.image.version="${VERSION}"
|
||||
LABEL org.opencontainers.image.url="https://gitea.com/gitea/tea"
|
||||
LABEL org.opencontainers.image.authors="Tamás Gérczei <tamas@gerczei.eu>"
|
||||
LABEL org.opencontainers.image.created="${BUILD_DATE}"
|
||||
LABEL org.opencontainers.image.source="https://github.com/tgerczei/conteaner"
|
||||
LABEL org.opencontainers.image.vendor="Gérczei Tamás E.V."
|
||||
COPY --from=buildenv /tea /
|
||||
ENV HOME="/app"
|
||||
ENTRYPOINT ["/tea"]
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
## tea: A command line tool to interact with Gitea servers
|
||||
|
||||
### Build
|
||||
- docker build . -t gitea/tea:0.3.0
|
||||
- docker build . -t gitea/tea:0.5.0
|
||||
|
||||
...or to build a specific release (check [here](https://gitea.com/gitea/tea/releases)):
|
||||
|
||||
|
@ -16,7 +16,7 @@ The version of Go used during the build can also be overridden by appending e.g.
|
|||
|
||||
### Configuration
|
||||
- docker volume create tea
|
||||
- alias tea='docker run --rm -v tea:/app gitea/tea:<b><your_release></b>'
|
||||
- alias tea='docker run --rm -v tea:/app -v $PWD:/repo:ro -w /repo gitea/tea:<b><your_release></b>'
|
||||
- tea login add -n <b><name_this_login></b> -u <b><your_gitea_url></b> -t <b><your_gitea_application_token></b> -i
|
||||
|
||||
### Usage
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
#!/bin/sh
|
||||
docker build --build-arg BUILD_DATE=$(date -u +%Y-%m-%dT%H:%M:%SZ) -t $IMAGE_NAME .
|
Loading…
Reference in New Issue