Open etnbrd opened 6 years ago
I was used to acbuild
way of providing the tarball, and missed this issue #107 that specifies that the from
directive from container.yml
is equivalent to the FROM
from a dockerfile.
So the way to do this with ansible-container
and Docker would be to specify from: scratch
, and then a role with the tarball.
Feel free to close this issue if this is correct.
That's more or less accurate. I'd be interested to hear how this goes for you.
Trying to use from: scratch
in container.yml
, ansible-container
tries to pull the scratch image, the scratch image used to be a regular image, but as of commit 8936789 it is a special case, and cannot be used with 'docker pull.'
Failed to pull scratch: 500 Server Error: Internal Server Error ("'scratch' is a reserved name")
Did I miss something? Flag, configuration setting?
Nope. You didn't miss anything - I did. Thanks for pointing me to that commit. sigh
My advice would be to roll your own scratch
. It should be straightforward. Something like:
tar -czf - --files-from /dev/null | docker import - my-scratch
Good luck!
Thanks, my-scratch
looks good, have used tianon/true
for testing. I get this error when trying to apply any role to the my-scratch
or tianon/true
image:
docker.errors.APIError: 500 Server Error: Internal Server Error ("linux spec user: unable to find user root: no matching entries in passwd file")
My role just tries to copy some file into the container.
ISSUE TYPE
Is it possible to build images from scratch with
ansible-container
?Based on this issue #52 mentionning an
--from-scratch
option, I am under the impression that it is possible, but can't find the relative documentation (no mention in the build documentation)How could one provide a rootfs tarball instead of a base image, to build images from scratch ?