Skip to content

fix(build): disable jar creation for authorization server #6

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fablefebvre
Copy link

I just tried to build Chapter11 and faced this issue:

Step 3/12 : ADD ./build/libs/*.jar app.jar
When using ADD with more than one source file, the destination must be a directory and end with a /
ERROR: Service 'auth-server' failed to build : Build failed
➜  Chapter11 git:(main) ✗ ll spring-cloud/authorization-server/build/libs
total 47M
-rw-rw-r-- 1 a506486 a506486 47M Dec 15 15:15 authorization-server-1.0.0-SNAPSHOT.jar
-rw-rw-r-- 1 a506486 a506486 12K Dec 15 15:15 authorization-server-1.0.0-SNAPSHOT-plain.jar
➜  Chapter11 git:(fix/chapter-11) ✗

This PR should fix that.

@magnus-larsson
Copy link
Collaborator

Hello and thanks for reporting this issue!

It seems that this issue only happens if you use Docker without BuildKit, but I will of course apply your PR to Chapter 11 and beyond anyhow. The problem disappears if you enable the BuildKit with the command:

DOCKER_BUILDKIT=1 docker compose build auth-server

Note #1: BuildKit is the default builder in Docker engine since v23.0, see https://docs.docker.com/engine/release-notes/23.0/#2300

Note #2: if you want to know more about this difference in the old and new builder in Docker engine, see moby/buildkit#1853

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

Successfully merging this pull request may close these issues.

2 participants