Skip to content

Updated busybox sha; Added dependabot. #4202

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

Merged
merged 1 commit into from
May 7, 2021
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
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package_manager: "gomod"
directory: "/"
vendor: false
schedule:
interval: "weekly"
labels: ["dependencies"]
- package_manager: "docker"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not see any rule about busybox SHA update rule, is it a magic?

Copy link
Member Author

@bwplotka bwplotka May 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It actually works with digest, but not sure how it can detect ARM/AMD tbh, so that will not for now. Still I want to try this path (:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's try it :)

directory: "/"
schedule:
interval: "weekly"
labels: ["dependencies"]

4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# By default we pin to amd64 sha. Use make docker to automatically adjust for arm64 versions.
ARG SHA="14d68ca3d69fceaa6224250c83d81d935c053fb13594c811038c461194599973"
FROM quay.io/prometheus/busybox@sha256:${SHA}
ARG BASE_DOCKER_SHA="14d68ca3d69fceaa6224250c83d81d935c053fb13594c811038c461194599973"
FROM quay.io/prometheus/busybox@sha256:${BASE_DOCKER_SHA}
LABEL maintainer="The Thanos Authors"

COPY /thanos_tmp_for_docker /bin/thanos
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.multi-stage
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# By default we pin to amd64 sha. Use make docker to automatically adjust for arm64 versions.
ARG SHA="14d68ca3d69fceaa6224250c83d81d935c053fb13594c811038c461194599973"
ARG BASE_DOCKER_SHA="14d68ca3d69fceaa6224250c83d81d935c053fb13594c811038c461194599973"
FROM golang:1.16-alpine3.12 as builder

WORKDIR $GOPATH/src/github.com/thanos-io/thanos
Expand All @@ -16,7 +16,7 @@ RUN git update-index --refresh; make build

# -----------------------------------------------------------------------------

FROM quay.io/prometheus/busybox@sha256:${SHA}
FROM quay.io/prometheus/busybox@sha256:${BASE_DOCKER_SHA}
LABEL maintainer="The Thanos Authors"

COPY --from=builder /go/bin/thanos /bin/thanos
Expand Down
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ DOCKER_IMAGE_REPO ?= quay.io/thanos/thanos
DOCKER_IMAGE_TAG ?= $(subst /,-,$(shell git rev-parse --abbrev-ref HEAD))-$(shell date +%Y-%m-%d)-$(shell git rev-parse --short HEAD)
DOCKER_CI_TAG ?= test

SHA=''
BASE_DOCKER_SHA=''
arch = $(shell uname -m)
# Run `DOCKER_CLI_EXPERIMENTAL=enabled docker manifest inspect quay.io/prometheus/busybox:latest` to get SHA or
# just visit https://quay.io/repository/prometheus/busybox?tag=latest&tab=tags.
# TODO(bwplotka): Pinning is important but somehow quay kills the old images, so make sure to update regularly (dependabot?)
# Update at 2020.2.01
# TODO(bwplotka): Pinning is important but somehow quay kills the old images, so make sure to update regularly.
# Update at 2021.6.07
ifeq ($(arch), x86_64)
# amd64
SHA="14d68ca3d69fceaa6224250c83d81d935c053fb13594c811038c461194599973"
BASE_DOCKER_SHA="de4af55df1f648a334e16437c550a2907e0aed4f0b0edf454b0b215a9349bdbb"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sha is different than the default sha's for amd64 in the dockerfiles? Wouldn't these be the same or do we use some fallback?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it is updated, notice the date in comment.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We just always set it, maybe I can remove the one in dockefiles

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it easier that all 'tools' use the same version no? I made this mistake by not understanding/seeing it :p See this PR: #4171

else ifeq ($(arch), armv8)
# arm64
SHA="4dd2d3bba195563e6cb2b286f23dc832d0fda6c6662e6de2e86df454094b44d8"
BASE_DOCKER_SHA="5591971699f6cf8abf6776495385e9d62751111a8cba56bf4946cf1d0de425ed"
else
echo >&2 "only support amd64 or arm64 arch" && exit 1
endif
Expand Down Expand Up @@ -147,7 +147,7 @@ docker: build
@echo ">> copying Thanos from $(PREFIX) to ./thanos_tmp_for_docker"
@cp $(PREFIX)/thanos ./thanos_tmp_for_docker
@echo ">> building docker image 'thanos'"
@docker build -t "thanos" --build-arg SHA=$(SHA) .
@docker build -t "thanos" --build-arg BASE_DOCKER_SHA=$(BASE_DOCKER_SHA) .
@rm ./thanos_tmp_for_docker
else
docker: docker-multi-stage
Expand All @@ -157,7 +157,7 @@ endif
docker-multi-stage: ## Builds 'thanos' docker image using multi-stage.
docker-multi-stage:
@echo ">> building docker image 'thanos' with Dockerfile.multi-stage"
@docker build -f Dockerfile.multi-stage -t "thanos" --build-arg SHA=$(SHA) .
@docker build -f Dockerfile.multi-stage -t "thanos" --build-arg BASE_DOCKER_SHA=$(BASE_DOCKER_SHA) .

.PHONY: docker-push
docker-push: ## Pushes 'thanos' docker image build to "$(DOCKER_IMAGE_REPO):$(DOCKER_IMAGE_TAG)".
Expand Down