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

extraDirectories directory that doesn't exist locally: in command-line(-Djib.extraDirectories.paths) #4184

Open
cebrailinanc opened this issue Feb 9, 2024 · 1 comment

Comments

@cebrailinanc
Copy link

cebrailinanc commented Feb 9, 2024

Environment:

  • Jib version: 3.4.0
  • Build tool: Gradle
  • OS: macos

Description of the issue:
I get an error when I try to build with the command line. Parameter -Djib.extraDirectories.paths parse incorrectly.
This code only receiving as from. Value of into always is '/'

Command:

./gradlew jibDockerBuild --image=poc-jib:latest -Djib.from.image=openjdk:21-slim -Djib.extraDirectories.paths='extra, /var/temp'

discussed here

Expected behavior:
should have copied the files in the extra to /var/temp

Steps to reproduce:

  1. I created a sample project (https://github.com/cebrailinanc/jib-demo)

Log output:

  • What went wrong:
    Execution failed for task ':jibDockerBuild'.
    extraDirectories.paths contain "from" directory that doesn't exist locally: /var/temp
@artemptushkin
Copy link

artemptushkin commented Mar 6, 2024

Hey I want to support this issue, given this comment I think we should be able to set to from the CLI too, currently it's not possible, e.g.

What I tried (all below not working), any option I'd expect to work to set both from and to from the CLI parameter:

# expect /app/config is in the image

./gradlew jibDockerBuild  -Djib.extraDirectories.paths='/Users/artemptushkin/foo/config,/app/config'

./gradlew jibDockerBuild  -Djib.extraDirectories.paths.path.from='/Users/artemptushkin/foo/config' -Djib.extraDirectories.paths.path.to='/app/config'

./gradlew jibDockerBuild -Djib.extraDirectories.paths=['/Users/artemptushkin/gitlab/IptiQ/dx/kotlin-app-example/config','/app/config']

What works is just from:

./gradlew jibDockerBuild  -Djib.extraDirectories.paths='/Users/artemptushkin/foo/config'

All the files and directories from foo/config will be in the root of the image. We can use it still make more directories in from so we emulate the path in the target image, e.g.

from:

  • /Users/artemptushkin/foo/config/app/test -> expect /app/test directory in the image

If it's should be another issue - let me know, I will create one

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

No branches or pull requests

3 participants