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

Is there a way to add a volume in image ? #1121

Closed
laurentleseigneur opened this issue Oct 9, 2018 · 9 comments
Closed

Is there a way to add a volume in image ? #1121

laurentleseigneur opened this issue Oct 9, 2018 · 9 comments
Milestone

Comments

@laurentleseigneur
Copy link

Image don't allows to have a volume:

my project is a CLI that uses a folder as arg to run. I would like to run produced docker image with a volume to bind to some host folder

Expected behavior:

add some volume parameter when configuring maven/gradle plugin

@coollog coollog added this to the 0.10.1 milestone Oct 9, 2018
@coollog
Copy link
Contributor

coollog commented Oct 9, 2018

Hi @laurentleseigneur , thanks for your suggestions! Currently we do not provide configuration for setting the volume, but we'll look into this as a potential feature.

@coollog
Copy link
Contributor

coollog commented Oct 31, 2018

The proposal is to add a <container><volumes>/jib.container.volumes configuration parameter:

Examples:

<configuration>
  <container>
    <volumes>
      <volume>/var/job-result-data</volume>
      <volume>/var/log/my-app-logs</volume>
    <volumes>
  </container>
</configuration>
jib.container.volumes = ['/var/job-result-data', '/var/log/my-app-logs']
Jib.from(...)
   .addVolume('/var/job-result-data')
   .addVolume(AbsoluteUnixPath.get('/var/job-result-data'))
   .containerize(...);

This will add a "Volumes" section to the container configuration "config" object:

{
  "config": {
    ...
    "Volumes": {
      "/var/job-result-data": {},
      "/var/log/my-app-logs": {}
    },
  }
}

@paivagustavo
Copy link
Contributor

Hey @coollog wanna some help with these? This seems cool.

@coollog
Copy link
Contributor

coollog commented Nov 1, 2018

Hey @GuustavoPaiva , we’d be glad to have your help on this! Let us know if you have any questions. One thing is that this is probably better done as multiple PRs, like one for the jib-core changes, one for the jib-maven-plugin changes, and one for the jib-gradle-plugin changes.

@coollog
Copy link
Contributor

coollog commented Nov 19, 2018

@GuustavoPaiva , let us know if you'd like to handle the jib-maven-plugin/jib-gradle-plugin changes as well!

@paivagustavo
Copy link
Contributor

Hey @coollog I plan to do this by the end of this week, is it fine?

@chanseokoh
Copy link
Member

@GuustavoPaiva sure, we welcome your help.

@chanseokoh
Copy link
Member

Fixed by #1278. @GuustavoPaiva thanks again for your help!

@laurentleseigneur
Copy link
Author

thanks you all for adding this feature in Jib!

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

No branches or pull requests

4 participants