nifi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Wilcsinszky <peterwilcsins...@gmail.com>
Subject Re: Question on Docker module
Date Thu, 07 Jun 2018 14:25:19 GMT
Hi,

Disclaimer: I've been working with the nifi-docker module for only a couple
of weeks now so I'm relatively new to this.
Unfortunately there's no way I'm aware of right now using a pure Dockerfile
to implement a build time switch for cases like this where you have a
a) locally
built binary b) remote artifact.
There is the ADD [1] instruction that combines something like that, but it
falls short when used with a custom user and a big artifact, like in our
case. The problem with that is that even if you provide the nifi user with
--chown flag, docker uses that only to set the ownership of the downloaded
archive, but then the extraction happens and ownership info will be used
based on whatever was set in the archive [2].
Given that, you will need one extra instruction to set the ownership of the
extracted files and boom, you now have double the size of your image [3].
This is why it is wise to do the download and chown in one instruction,
like in the dockerhub Dockerfile [4]
But back to scenario a) You have the files built with maven locally, but
you can't use curl to download it, because it is not hosted anywhere. While
I'm writing this I can think of a theoretical option to implement something
to host the file locally for the docker container to consume. With that we
could avoid the separate maven Dockerfile, but until then we are left with
the ADD instruction, following with a chown that makes that image almost
3G...

For now I'm adding some integration tests for both scenarios [5], but would
be glad to hear others feedback as well!

[1] https://docs.docker.com/engine/reference/builder/#add
[2] https://github.com/moby/moby/issues/35525#issuecomment-344908030
[3] https://github.com/moby/moby/issues/22810#issuecomment-220021580
[4]
https://github.com/apache/nifi/blob/master/nifi-docker/dockerhub/Dockerfile#L45
[5] https://github.com/apache/nifi/pull/2747

On Thu, Jun 7, 2018 at 3:37 PM Jeremy Dyer <jdye64@gmail.com> wrote:

> Sivaprasanna - They are very similar but different. Exists to primarily
> assist with speeding up a developers dev cycle. Its purpose is to allow you
> to make source code changes to NiFi, build with maven (including docker
> image), and then run the container with your latest changes. So in a sense
> you can think of the docker maven module as providing you with the latest
> from master. The dockerhub module on the other hand is used to build an
> image for a stable Apache validated release. The current dockerhub build
> will pull down Apache NiFi 1.6 from the Apache mirrors.
>
> TLDR: In cases outside of development you should use the dockerhub one.
>
> Thanks,
> Jeremy Dyer
>
> On Thu, Jun 7, 2018 at 9:09 AM, Sivaprasanna <sivaprasanna246@gmail.com>
> wrote:
>
> > Team,
> >
> > In the project's nifi-docker
> > <https://github.com/apache/nifi/tree/master/nifi-docker> module, we have
> > two things: dockerhub and dockermaven. Are they one and the same or they
> > are there for different purposes? I have to warn you I don't know much
> > about 'dockerfile-maven-plugin' so some light on this might help me
> > understand the differences (if at all).
> >
> > Thanks,
> > Sivaprasanna
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message