-
Notifications
You must be signed in to change notification settings - Fork 63
Description
Hi,
I am trying to build a new package, with the idea of submitting a pull request to subuser-security/subuser-default-repository.
However, I am finding this being more difficult than it should be, especially in terms of build time and bandwidth consumption.
I have been following the packaging tutorial and I have already contributed a package in the past.
Here's my package structure:
electrum-base
├── image
│ └── SubuserImagefile
└── permissions.json
Now, I would change SubuserImagefile
and then I would try to build it with:
$ subuser subuser add electrum-test-01 electrum-base@./
Let's say that this build fails at some point in the middle because of some error in the SubuserImagefile
, in this case I would need to change the SubuserImagefile
and try to build again:
$ subuser subuser add electrum-test-02 electrum-base@./
This takes quite a long time because all the command in the SubuserImagefile
are executed from scratch, subuser is not reusing intermediate images even if a part of the previous built was successful.
I have tested it with an image with no apt-get update
or apt-get upgrade
commands because I know that this command produce different inputs and so the layers created would be different.
I tested this by adding the line at the end of the SubuserImagefile
:
RUN echo 'All done!'
and the image gets rebuilt from scratch.
In principle subuser should be able to reuse the intermediate images when they are the same, which is something that Docker can do when building, if I recall correctly.
So, am I doing something wrong?
p.s.: furthermore, I would also say that it would be nice to have a way to have sudo
in containers (see also #324) so that I could launch a shell in a subuser and try out commands in a partial build. Should I file a separate bug with this request?