Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create quickstart local image builder unless existing builder #1261

Merged
merged 1 commit into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions quickstart/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,16 @@ First, decide what you are trying to do. Are you trying to:
1. change to this directory from checkout root: `cd quickstart/docker`
1. run the script `./createLocalImage.sh` which will create a `openziti/quickstart:latest` tag
using the latest `ziti` [release from GitHub](https://github.com/openziti/ziti/releases/latest)
1. Optionally, you may provide an argument for the image tag. `./createLocalImage.sh <tagname>`
1. Optionally, you may provide an argument, e.g., `./createLocalImage.sh <tagname>`, to create a tag
other than `latest`.

## Build Docker Image with Specific ziti Version
1. change to this directory from checkout root: `cd quickstart/docker`
1. set `ZITI_VERSION_OVERRIDE` to desired version: `export ZITI_VERSION_OVERRIDE=v0.28.4`
1. run the script `./createLocalImage.sh` which will create a `openziti/quickstart:latest` tag
using the specified version of `ziti` [from GitHub](https://github.com/openziti/ziti/releases/tag/v0.28.4)
1. Optionally, you may provide an argument for the image tag. `./createLocalImage.sh <tagname>`

## ERROR: existing instance for "ziti-builder"
When running the `./createLocalImage.sh` script, you might get this error:
```
ERROR: existing instance for "ziti-builder" but no append mode, specify --node to make changes for existing instances
```
It's probably safest to just remove the buildx builder using:
```
docker buildx rm ziti-builder
```

1. Optionally, you may provide an argument, e.g., `./createLocalImage.sh <tagname>`, to create a tag
other than `latest`.

## Build Docker Image For Publication
To publish the latest `ziti` CLI, use [the GitHub Action](https://github.com/openziti/ziti/actions/workflows/push-quickstart.yml).
Expand Down
6 changes: 3 additions & 3 deletions quickstart/docker/image/fetch-ziti-bins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dest="${1}"
if [ -d /docker.build.context/ziti-bin ]; then
mv /docker.build.context/ziti-bin/ "${dest}"
else
source /docker.build.context/ziti-cli-functions.sh
getZiti
mv "${ZITI_BIN_DIR}" "${dest}"
source /docker.build.context/ziti-cli-functions.sh
getZiti
mv "${ZITI_BIN_DIR}" "${dest}"
fi
11 changes: 7 additions & 4 deletions quickstart/docker/pushLatestDocker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ if [ -z "${IMAGE_TAG}" ]; then
echo "image tag name was not provided, using default '${IMAGE_TAG}'"
fi

docker buildx create --use --name=ziti-builder

if [ "local" == "${1}" ]; then
echo "LOADING LOCALLY instead of pushing to dockerhub"
_BUILDX_PLATFORM=""
Expand All @@ -31,8 +29,13 @@ else
_BUILDX_PLATFORM="--platform linux/amd64,linux/arm64"
_BUILDX_ACTION="--push"
fi
docker buildx build ${_BUILDX_PLATFORM} "${SCRIPT_DIR}/image" \

docker buildx create \
--use --name=ziti-builder --driver docker-container 2>/dev/null \
|| docker buildx use --default ziti-builder

eval docker buildx build "${_BUILDX_PLATFORM}" "${SCRIPT_DIR}/image" \
--build-arg ZITI_VERSION_OVERRIDE="v${ZITI_VERSION}" \
--tag "openziti/quickstart:${ZITI_VERSION}" \
--tag "openziti/quickstart:${IMAGE_TAG}" \
${_BUILDX_ACTION}
"${_BUILDX_ACTION}"