2

I'm using the Jib Maven plugin to build a container image, and have the following issue: sometimes the locally available base image (e.g. foo/bar/base/parent-image:latest) becomes older than the one available in the remote repository.

Invoking manually docker pull parent-image:latest pulls the most current :latest version, but I'd like this to happen automatically every time my image is built, similarly to the --pull parameter of Docker CLI: docker build --pull my-image:latest.

Can this (always pulling the base image before image build) be obtained with current version (3.2.1) of Jib Maven plugin?

I tried prefixing the base image with registry:// like described in "Setting the base image", and it makes no difference:

      <from>
        <image>registry://foo/bar/base/parent-image:latest</image>
      </from>

I could try to set the base image cache directory, described in "System Properties", to a random temp directory, but I don't want such a overkill workaround.

t0r0X
  • 4,212
  • 1
  • 38
  • 34
  • Seems to be the default behaviour with 3.3.2, far as I can tell. – Raphael Jun 12 '23 at 16:18
  • @Raphael Thanks for the hint. Currently I'm using 3.3.1 and haven't upgraded to 3.3.2. because the changelog didn't seem to mention relevant changes. I'll reinvestigate later this week. – t0r0X Jun 14 '23 at 07:07
  • I guess that would be a breaking change, so a patch bump shouldn't change things. Maybe I misinterpreted the behaviour I saw; seemed to _me_ it always tried to pull unless I used `docker://..` in ``. (Which I didn't want because the image I used only existed locally, not on any registry.) – Raphael Jun 14 '23 at 16:49

0 Answers0