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

ci: comments why we don't cache ~/.docker #3621

Merged
merged 2 commits into from
Dec 7, 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
5 changes: 3 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ jobs:
with:
path: ~/.npm
key: ${{ runner.os }}-npm-packages-${{ hashFiles('zipkin-lens/package-lock.json') }}
# We can't cache Docker without using buildx because GH actions restricts /var/lib/docker
# That's ok because DOCKER_PARENT_IMAGE is always ghcr.io and local anyway.
# Don't attempt to cache Docker. Sensitive information can be stolen
# via forks, and login session ends up in ~/.docker. This is ok because
# we publish DOCKER_PARENT_IMAGE to ghcr.io, hence local to the runner.
- name: Deploy
env:
# GH_USER=<user that created GH_TOKEN>
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/docker_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 1 # only needed to get the sha label
# We can't cache Docker without using buildx because GH actions restricts /var/lib/docker
# That's ok because DOCKER_PARENT_IMAGE is always ghcr.io and local anyway.
# Don't attempt to cache Docker. Sensitive information can be stolen
# via forks, and login session ends up in ~/.docker. This is ok because
# we publish DOCKER_PARENT_IMAGE to ghcr.io, hence local to the runner.
- name: Docker Push
run: | # GITHUB_REF will be refs/tags/docker-MAJOR.MINOR.PATCH
build-bin/git/login_git &&
Expand Down
2 changes: 1 addition & 1 deletion build-bin/docker/configure_docker
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright 2015-2021 The OpenZipkin Authors
# Copyright 2015-2023 The OpenZipkin Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion build-bin/docker/configure_docker_push
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright 2015-2021 The OpenZipkin Authors
# Copyright 2015-2023 The OpenZipkin Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion build-bin/docker/docker_arch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright 2015-2021 The OpenZipkin Authors
# Copyright 2015-2023 The OpenZipkin Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion build-bin/docker/docker_args
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright 2015-2021 The OpenZipkin Authors
# Copyright 2015-2023 The OpenZipkin Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
Expand Down
9 changes: 7 additions & 2 deletions build-bin/docker/docker_build
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright 2015-2021 The OpenZipkin Authors
# Copyright 2015-2023 The OpenZipkin Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
Expand All @@ -19,5 +19,10 @@ docker_tag=${1?full docker_tag is required. Ex openzipkin/zipkin:test}
version=${2:-}
docker_args=$($(dirname "$0")/docker_args ${version})

# We don't need build kit, but Docker 20.10 no longer accepts --platform
# without it. It is simpler to always enable it vs require maintainers to use
# alternate OCI tools. See https://github.com/moby/moby/issues/41552
export DOCKER_BUILDKIT=1

echo "Building image ${docker_tag}"
DOCKER_BUILDKIT=1 docker build --network=host --pull ${docker_args} --tag ${docker_tag} .
docker build --network=host --pull ${docker_args} --tag ${docker_tag} .
6 changes: 5 additions & 1 deletion build-bin/docker/docker_push
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright 2015-2021 The OpenZipkin Authors
# Copyright 2015-2023 The OpenZipkin Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
Expand All @@ -27,6 +27,10 @@ set -ue

docker_image=${1?docker_image is required, notably without a tag. Ex openzipkin/zipkin}
version=${2:-master}

# We don't need build kit, but Docker 20.10 no longer accepts --platform
# without it. It is simpler to always enable it vs require maintainers to use
# alternate OCI tools. See https://github.com/moby/moby/issues/41552
export DOCKER_BUILDKIT=1

case ${version} in
Expand Down
Loading