Skip to content

Commit

Permalink
Update container build README to mention release.Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
amisevsk committed Aug 29, 2024
1 parent da2ccd8 commit d14a694
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/next-container-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
push:
branches:
- main
paths-ignore: docs/

env:
REGISTRY: ghcr.io
Expand Down
4 changes: 2 additions & 2 deletions build/dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM docker.io/library/golang:alpine AS builder

RUN apk --no-cache upgrade && apk add --no-cache git
ARG version=next
ARG KIT_VERSION=next

WORKDIR /build

Expand All @@ -13,7 +13,7 @@ COPY . .
RUN \
CGO_ENABLED=0 go build \
-o kit \
-ldflags="-s -w -X kitops/pkg/lib/constants.Version=${version} -X kitops/pkg/lib/constants.GitCommit=$(git rev-parse --short HEAD) -X kitops/pkg/lib/constants.BuildTime=$(date -u +'%Y-%m-%dT%H:%M:%SZ')"
-ldflags="-s -w -X kitops/pkg/lib/constants.Version=${KIT_VERSION} -X kitops/pkg/lib/constants.GitCommit=$(git rev-parse --short HEAD) -X kitops/pkg/lib/constants.BuildTime=$(date -u +'%Y-%m-%dT%H:%M:%SZ')"

FROM docker.io/library/alpine
ENV USER_ID=1001 \
Expand Down
25 changes: 20 additions & 5 deletions build/dockerfiles/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
# Containerized Kit CLI

The Dockerfile in this directory can be used for building a containerized version of the Kit CLI. To build this image manually, run the following command from the root of this repository:
```bash
docker build -t kit-cli:latest -f build/dockerfiles/Dockerfile .
The Dockerfiles in this directory can be used for building a containerized version of the Kit CLI. The default entrypoint
for these image is invoking the `kit` CLI, allowing for quickly running Kit commands without needing to install the CLI:
```
docker run --rm ghcr.io/jozu-ai/kit:latest version
```

The default entrypoint for this image is invoking the `kit` CLI, allowing for quickly running Kit commands without needing to install the CLI:
## Release build
The dockerfile named `release.Dockerfile` will build a container that includes a specified release of the Kit CLI, downloaded
from GitHub releases. To build this container to include Kit version `vX.Y.Z`, use the following command
```bash
docker build -t kit-cli:my-tag -f build/dockerfiles/release.Dockerfile --build-arg KIT_VERSION=vX.Y.Z .
```
docker run --rm ghcr.io/jozu-ai/kit:latest version
Note, the `KIT_VERSION` build arg is required.


## Offline build
The dockerfile named `Dockerfile` will build a container by compiling the Kit CLI from local sources. To build this image
manually, run the following command from the root of this repository:

```bash
docker build -t kit-cli:next -f build/dockerfiles/Dockerfile .
```
By default, this container will set the Kit CLI version inside the container to `next`. To override this, you can specify
the build arg `KIT_VERSION`.

0 comments on commit d14a694

Please sign in to comment.