Skip to content
This repository has been archived by the owner on Aug 25, 2023. It is now read-only.

Commit

Permalink
fix: Docker warning when using frapsoft/openssl on arm64 system
Browse files Browse the repository at this point in the history
Resolved a warning from Docker that would get printed when running the generate-test-keys Makefile target on an arm64 system. The warning from Docker alerts you that the image for frapsoft/openssl is for amd64, which doesn't match the system you're on (when using an arm64-based OS). To resolve the warning, you have to either use an image that matches the system architecture, or explicitly state the platform using the --platform flag. In this case, there is only an amd64 version of frapsoft/openssl, so I added the explicit flag to resolve the warning. I also added a TODO for us to find an arm64 alternative in the future (although the amd64 version of frapsoft/openssl does seem to work fine on arm64 Mac OS currently, presumably due to Apple's Rosetta translation layer or some other emulation layer).

Signed-off-by: Derek Trider <Derek.Trider@securekey.com>
  • Loading branch information
Derek Trider committed Sep 15, 2022
1 parent 569b5e2 commit 1a115fe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,12 @@ mock-login-consent-docker:
@echo "Building mock login consent server"
@cd test/bdd/mock/loginconsent && docker build -f image/Dockerfile --build-arg GO_VER=$(GO_VER) --build-arg ALPINE_VER=$(ALPINE_VER) -t mockloginconsent:latest .

# TODO (#334): frapsoft/openssl only has an amd64 version. While this does work under amd64 and arm64 Mac OS currently,
# we should add an arm64 version for systems that can only run arm64 code.
.PHONY: generate-test-keys
generate-test-keys:
@mkdir -p ./test/bdd/fixtures/keys/tls
@docker run -i --rm \
@docker run -i --platform linux/amd64 --rm \
-v $(abspath .):/opt/workspace/kms \
--entrypoint "/opt/workspace/kms/scripts/generate_test_keys.sh" \
frapsoft/openssl
Expand Down

0 comments on commit 1a115fe

Please sign in to comment.