Skip to content

Conversation

johnstcn
Copy link
Member

@johnstcn johnstcn commented Apr 24, 2024

  • Adds a Makefile
  • Adds a local registry cache to avoid hitting Docker Hub rate-limits
  • Updates existing tests to reference locally cached images

Note: there is an existing in-memory registry implementation that I looked into using instead, but this was cheaper to implement.

@johnstcn johnstcn self-assigned this Apr 24, 2024
Copy link
Contributor

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

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

LGTM!

@johnstcn johnstcn merged commit f59bd37 into main Apr 24, 2024
@johnstcn johnstcn deleted the cj/local-registry branch April 24, 2024 10:10
./scripts/develop.sh

build: scripts/envbuilder-$(GOARCH)
./scripts/build.sh
Copy link
Member

Choose a reason for hiding this comment

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

These seem like they should be phony atm?


.PHONY: test
test: test-registry test-images
go test -count=1 ./...
Copy link
Member

Choose a reason for hiding this comment

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

Count will disable go caching, let's remove it as I imagine anyone developing the project would prefer caching on?

.registry-cache:
mkdir -p .registry-cache && chmod -R ag+w .registry-cache

.registry-cache/docker/registry/v2/repositories/envbuilder-test-alpine:
Copy link
Member

Choose a reason for hiding this comment

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

These should perhaps depend on the test-registry?

@@ -605,7 +609,7 @@ func TestPrivateRegistry(t *testing.T) {
})
t.Run("Auth", func(t *testing.T) {
t.Parallel()
image := setupPassthroughRegistry(t, "library/alpine", &registryAuth{
image := setupPassthroughRegistry(t, "envbuilder-test-alpine:latest", &registryAuth{
Copy link
Member

Choose a reason for hiding this comment

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

Is it intentional to use hard-coded name here, compared to e.g. testImageAlpine?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants