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

adds docker support for multiple architectures #832

Merged
merged 2 commits into from
Aug 12, 2024
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
39 changes: 27 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,34 @@

.PHONY: build-keri
build-keri:
@docker buildx build --platform=linux/amd64 -f images/keripy.dockerfile --tag weboftrust/keri:1.2.0-dev12 .
@docker buildx build --platform=linux/arm64 -f images/keripy.dockerfile --tag weboftrust/keri:1.2.0-dev12-arm64 .

.PHONY: build-witness-demo
build-witness-demo:
@@docker buildx build --platform=linux/amd64 -f images/witness.demo.dockerfile --tag weboftrust/keri-witness-demo:1.1.10 .
@@docker buildx build --platform=linux/arm64 -f images/witness.demo.dockerfile --tag weboftrust/keri-witness-demo:1.1.10-arm64 .
VERSION=MULTI_ARCH_TEST

.PHONY: publish-keri
publish-keri:
@docker push weboftrust/keri:1.2.0-dev12
@docker push weboftrust/keri:1.2.0-dev12-arm64
define DOCKER_WARNING
In order to use the multi-platform build enable the containerd image store
The containerd image store is not enabled by default.
To enable the feature for Docker Desktop:
Navigate to Settings in Docker Desktop.
In the General tab, check Use containerd for pulling and storing images.
Select Apply and Restart."
endef

build-keri: .warn
@docker build --platform=linux/amd64,linux/arm64 -f images/keripy.dockerfile -t weboftrust/keri:$(VERSION) .

.PHONY: build-witness-demo
build-witness-demo: .warn
@docker build --platform=linux/amd64,linux/arm64 -f images/witness.demo.dockerfile -t weboftrust/keri-witness-demo:1.1.10 .

.PHONY: publish-keri-witness-demo
publish-keri-witness-demo:
@docker push weboftrust/keri-witness-demo --all-tags
@docker push weboftrust/keri-witness-demo --all-tags

publish-keri:
@docker push weboftrust/keri:$(VERSION)

.warn:
@echo -e ${RED}"$$DOCKER_WARNING"${NO_COLOUR}

RED="\033[0;31m"
NO_COLOUR="\033[0m"
export DOCKER_WARNING
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,17 @@ pytest tests/demo/
* Build with Sphinx in `/docs`:
* `$ make html`

## Publishing containers

Enable the containerd image store

The containerd image store isn't enabled by default. To enable the feature for Docker Desktop:

Navigate to Settings in Docker Desktop.
In the General tab, check Use containerd for pulling and storing images.
Select Apply & Restart.

```shell
make build-keri
make publish-keri
```
15 changes: 0 additions & 15 deletions images/keripy.base.dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion images/keripy.dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG BASE=python:3.12.3-alpine3.20

FROM ${BASE} as builder
FROM ${BASE} AS builder

RUN apk add --no-cache bash

Expand Down
Loading