larsks / dockerize

A tool for creating minimal docker images from dynamic ELF binaries.
GNU General Public License v3.0
355 stars 41 forks source link

enable support for other container image building tools #24

Closed cz172638 closed 4 years ago

cz172638 commented 4 years ago

pull request for #23 tested with podman and buildah

indy@localhost:~$ dockerize --debug -t sed:buster-latest /usr/bin/sed
DEBUG:dockerize.dockerize:ENTRYPOINT: ["/usr/bin/sed"]
DEBUG:dockerize.dockerize:tag: sed:buster-latest
INFO:dockerize.dockerize:start build process
INFO:dockerize.dockerize:copying file /usr/bin/sed to /usr/bin/sed
INFO:dockerize.dockerize:running: ['rsync', '-a', '--copy-unsafe-links', '/usr/bin/sed', '/tmp/dockerize1aunlvf7/usr/bin/sed']
INFO:dockerize.depsolver:getting dependencies for /tmp/dockerize1aunlvf7/usr/bin/sed
DEBUG:dockerize.depsolver:/tmp/dockerize1aunlvf7/usr/bin/sed is not a dynamically linked ELF binary (ignoring)
INFO:dockerize.dockerize:populating misc config files
INFO:dockerize.dockerize:generating Dockerfile
INFO:dockerize.dockerize:building Docker image using docker --build
STEP 1: FROM scratch
STEP 2: COPY . /
--> aa833fddba0
STEP 3: ENTRYPOINT ["/usr/bin/sed"]
STEP 4: COMMIT sed:buster-latest
--> 7c17fd58452
7c17fd58452857f2b43418b2e18cd2653584db4d4476dc8ced97dbe7b35627e7
indy@localhost:~$ dockerize --debug -T podman -t sed:buster-latest /usr/bin/sed
DEBUG:dockerize.dockerize:ENTRYPOINT: ["/usr/bin/sed"]
DEBUG:dockerize.dockerize:tag: sed:buster-latest
INFO:dockerize.dockerize:start build process
INFO:dockerize.dockerize:copying file /usr/bin/sed to /usr/bin/sed
INFO:dockerize.dockerize:running: ['rsync', '-a', '--copy-unsafe-links', '/usr/bin/sed', '/tmp/dockerize7p6u2vhy/usr/bin/sed']
INFO:dockerize.depsolver:getting dependencies for /tmp/dockerize7p6u2vhy/usr/bin/sed
DEBUG:dockerize.depsolver:/tmp/dockerize7p6u2vhy/usr/bin/sed is not a dynamically linked ELF binary (ignoring)
INFO:dockerize.dockerize:populating misc config files
INFO:dockerize.dockerize:generating Dockerfile
INFO:dockerize.dockerize:building Docker image using podman --build
STEP 1: FROM scratch
STEP 2: COPY . /
--> 1e99a43424d
STEP 3: ENTRYPOINT ["/usr/bin/sed"]
STEP 4: COMMIT sed:buster-latest
--> 67b20ab7374
67b20ab73745f1905e3503dcd7ca188b1de4a38d34d8999f68fe3791e05bba6c
indy@localhost:~$ dockerize --debug -T buildah -b build-using-dockerfile -t sed:buster-latest /usr/bin/sed
DEBUG:dockerize.dockerize:ENTRYPOINT: ["/usr/bin/sed"]
DEBUG:dockerize.dockerize:tag: sed:buster-latest
INFO:dockerize.dockerize:start build process
INFO:dockerize.dockerize:copying file /usr/bin/sed to /usr/bin/sed
INFO:dockerize.dockerize:running: ['rsync', '-a', '--copy-unsafe-links', '/usr/bin/sed', '/tmp/dockerize3z46951p/usr/bin/sed']
INFO:dockerize.depsolver:getting dependencies for /tmp/dockerize3z46951p/usr/bin/sed
DEBUG:dockerize.depsolver:/tmp/dockerize3z46951p/usr/bin/sed is not a dynamically linked ELF binary (ignoring)
INFO:dockerize.dockerize:populating misc config files
INFO:dockerize.dockerize:generating Dockerfile
INFO:dockerize.dockerize:building Docker image using buildah --build-using-dockerfile
STEP 1: FROM scratch
STEP 2: COPY . /
STEP 3: ENTRYPOINT ["/usr/bin/sed"]
STEP 4: COMMIT sed:buster-latest
Getting image source signatures
Copying blob 20a36c62c7b8 done
Copying config 293b68e796 done
Writing manifest to image destination
Storing signatures
--> 293b68e7965
293b68e79650933d93fe7821f143dbc5c6afc0a3aae0405ea96cbaf3eb482a20
indy@localhost:~$
larsks commented 4 years ago

Thanks for the contribution! I made some minor changes, but otherwise it looks fine. Sorry it took me a while to get to this :).