Skip to content
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
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*
!record_api
!pyproject.toml
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ Then you can test an image locally, to make sure the Dockerfile builds correctly
```bash
cd k8
make test-local-<LIBRARY NAME>

# to test against the local python package, instead of the released one
make PYTHON_PACKAGE=. test-local-<LIBRARY NAME>
```

This should output a number of lines of traces.
Expand Down
18 changes: 9 additions & 9 deletions k8/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@

TO_MODULES := pandas,numpy
PYTHON_PACKAGE_VERSION := $(shell python -c 'import record_api; print(record_api.__version__)')
PYTHON_PACKAGE ?= record_api==${PYTHON_PACKAGE_VERSION}

$(info Python package version = ${PYTHON_PACKAGE_VERSION})
$(info Python package = ${PYTHON_PACKAGE})

IMAGE := registry.digitalocean.com/python-record-api

Expand Down Expand Up @@ -96,6 +97,12 @@ push-images: docker-bake.json
docker buildx bake --push

test-local-%:
env DOCKER_BUILDKIT=1 docker build \
--tag ${BASE_IMAGE} \
--file images/base/Dockerfile \
--build-arg "PYTHON_PACKAGE=${PYTHON_PACKAGE}" \
..

env DOCKER_BUILDKIT=1 docker build \
--tag $(call sub_image,$(*F)) \
--build-arg "FROM=${BASE_IMAGE}" \
Expand All @@ -119,13 +126,6 @@ test-remote-%: docker-bake.json
--image=$(call sub_image,$(*F))


# push-images: $(addprefix push-image-,$(IMAGES))

# push-image-%:
# docker push saulshanabrook/python-record-api:$(*F)-$(TAG)

# build-images: docker-bake.json
# docker buildx bake


# Generate docker bake file with default group
Expand All @@ -151,7 +151,7 @@ define JQ_DOCKER_BAKE
"cache-to": ["type=registry,ref=${BASE_CACHE_IMAGE},mode=max"],
"cache-from": ["type=registry,ref=${BASE_CACHE_IMAGE}"],
args: {
PYTHON_PACKAGE_VERSION: "${PYTHON_PACKAGE_VERSION}"
PYTHON_PACKAGE: "${PYTHON_PACKAGE}"
},
tags: [
"${BASE_IMAGE}"
Expand Down