7

I am trying to specify a mount point in a kubernetes deployment descriptor and for that I need there to be a directory

volumeMounts:
            - name: volume-mount
              mountPath: /dev/bus/usb/003/005

to correspond to:

volumes:
        - name: my-host-volume
          hostPath:
            path: /dev/bus/usb/003/005

How do I create this using jib?

theduck
  • 2,589
  • 13
  • 17
  • 23
Average Bear
  • 191
  • 1
  • 3
  • 13

1 Answers1

6

UPDATE: newer Jib versions have the feature to allow specifying a copy destination directory when using <extraDirectories>. You no longer have to manually prepare the target directory structure beforehand.


Create an empty directory <project root>/src/main/jib/dev/bus/usb/003/005 in your source repo.

Details

Jib allows adding arbitrary extra files and directories using the <extraDirectories> (Maven / Gradle) configuration. Files and (sub-)directories under <extraDirectories> will be recursively copied into the root directory of the image. By default, <project root>/src/main/jib is one such "extra directory", so you can simply create an empty directory with the structure you like.

You can also tune the permissions of files and directories using <permissions> if you want.

Chanseok Oh
  • 3,920
  • 4
  • 23
  • 63