larsks / dockerize Goto Github PK
View Code? Open in Web Editor NEWA tool for creating minimal docker images from dynamic ELF binaries.
License: GNU General Public License v3.0
A tool for creating minimal docker images from dynamic ELF binaries.
License: GNU General Public License v3.0
I am wondering if it is possible to pass environment variables at the time of creation.
To push it further, would it make sense to support this tool as an extension in Dockerfile.
Ex:
DOCKERIZE [/path/to/the/binary1,/path/to/the/binary2,...]
The above would allow simply build the lean docker image with existing workflow thus broader reach.
I think that the default working dir of the image dockerize create is '/', can we add an optional argument like
`optional arguments:
-w, --wd change the working dir
And then, in the dockerfile
`FROM scratch
COPY . /
WORKDIR /home/great/music/
ENTRYPOINT ["/bin/bash"]
`
Thanks in advance
Hi,
I am trying to dockerize a program which I made (C++). It run perfectly from command line and when I run ldd it works but dockerize fails with error subprocess.CalledProcessError: Command '['/lib64/ld-linux-x86-64.so.2', '--list', '/tmp/dockerizeSUClXT/...']' returned non-zero exit status 127
any idea of what I am missing?
It'd be nice to have instructions in the README for installing dockerize.
EDIT: Preferably, without having to clone the git repository.
Hi there,
when I run dockerize I get the following:
$ dockerize dockerize -t php /Users/me/source/local/php-lxc/build/php-5.6.18/usr/local/php/bin
Traceback (most recent call last):
File "/usr/local/bin/dockerize", line 9, in <module>
load_entry_point('dockerize==0.2', 'console_scripts', 'dockerize')()
File "build/bdist.macosx-10.11-x86_64/egg/dockerize/main.py", line 117, in main
File "build/bdist.macosx-10.11-x86_64/egg/dockerize/dockerize.py", line 89, in add_file
ValueError: dockerize: container paths must be fully qualified
reproducer:
on debian buster:
install podman from repository mentioned in https://podman.io/getting-started/installation in debian section.
$ apt install python3-jinja2 python3-pyelftools tcpdump
$ pip3 install --user git+https://github.com/larsks/dockerize
$ dockerize -t tcpdump:buster-amd64-latest /usr/sbin/tcpdump
$ podman diff $(podman image list -n localhost/tcpdump:buster-amd64-latest --format "{{.ID}}")
A /Dockerfile
A /etc
A /etc/group
A /etc/nsswitch.conf
A /etc/passwd
A /usr
A /usr/sbin
A /usr/sbin/tcpdump
$
I've got this error while trying to run example from README:
$ dockerize -t sed /bin/sed
Traceback (most recent call last):
File "/home/kvs/.local/bin/dockerize", line 11, in <module>
sys.exit(main())
File "/home/kvs/.local/lib/python3.5/site-packages/dockerize/main.py", line 125, in main
app.build()
File "/home/kvs/.local/lib/python3.5/site-packages/dockerize/dockerize.py", line 122, in build
self.resolve_deps()
File "/home/kvs/.local/lib/python3.5/site-packages/dockerize/dockerize.py", line 200, in resolve_deps
deps.add(path)
File "/home/kvs/.local/lib/python3.5/site-packages/dockerize/depsolver.py", line 110, in add
self.get_deps(path)
File "/home/kvs/.local/lib/python3.5/site-packages/dockerize/depsolver.py", line 81, in get_deps
elf = ELFFile(path)
File "/home/kvs/.local/lib/python3.5/site-packages/dockerize/depsolver.py", line 36, in __init__
self.read_sections()
File "/home/kvs/.local/lib/python3.5/site-packages/dockerize/depsolver.py", line 48, in read_sections
if not line or not line[0].isdigit():
AttributeError: 'int' object has no attribute 'isdigit'
Used version (installed via pip):
$ dockerize --version
dockerize version 0.2.2
Hey there, a while back when I used your tool to try to get PHP standalone, I ran into the problem of resolving runtime dependencies.
Here is my solution to that https://github.com/mozzymoz/packager
I'm no python wizard, that is why I didn't make a PR, but could be sometime you might be interested in
docker command is hardcoded.
with symlink docker -> podman i was able to create container with rootless approach (see #22 ).
with option -T (as -t is already used) or similar we should be able to select which container engine/runtime to use.
Hi Lars,
It is really cool that you are producing so many open source tools. I don't see any license with them, however, so it will limit how much the code can be used in other projects. Could you add an open source license, perhaps Berkeley Three Clause or Public Domain, which are very compatible with open source projects? Take a look at these pages for information about selecting and including copyright and license statements.
https://www.jeffknupp.com/blog/2013/08/16/open-sourcing-a-python-project-the-right-way/
http://www.groklaw.net/article.php?story=20031231092027900
http://www.pydanny.com/cookie-project-templates-made-easy.html
https://tldrlegal.com/license/bsd-3-clause-license-%28revised%29
Thanks again and keep up the good work!
Dave
-a
flag with only one entry simply mirrors the folderThe application attempts to import the grp
module which obviously isn't going to fly on Windows. Please clarify what platforms this is supposed to run on in the README.
I'm trying to install scipy but it takes too much time to compile, is there a way to do that using dockerize.
Dockerfile
FROM gliderlabs/alpine:3.4
RUN apk add --no-cache
ca-certificates
python-dev
libstdc++
libgfortran
&& apk add --no-cache --virtual=build_dependencies
gfortran
g++
make
&& ln -s /usr/include/locale.h /usr/include/xlocale.h
&& mkdir -p /tmp/build
&& cd /tmp/build/
&& wget http://www.netlib.org/blas/blas-3.6.0.tgz
&& wget http://www.netlib.org/lapack/lapack-3.6.1.tgz
&& tar xzf blas-3.6.0.tgz
&& tar xzf lapack-3.6.1.tgz
&& cd /tmp/build/BLAS-3.6.0/
&& gfortran -O3 -std=legacy -m64 -fno-second-underscore -fPIC -c .f
&& ar r libfblas.a *.o
&& ranlib libfblas.a
&& mv libfblas.a /tmp/build/.
&& cd /tmp/build/lapack-3.6.1/
&& sed -e "s/frecursive/fPIC/g" -e "s/ ..// /g" -e "s/^CBLASLIB/#CBLASLIB/g" make.inc.example > make.inc
&& make lapacklib
&& make clean
&& mv liblapack.a /tmp/build/.
&& cd /
&& export BLAS=/tmp/build/libfblas.a
&& export LAPACK=/tmp/build/liblapack.a
&& python -m pip --no-cache-dir install pip -U
&& python -m pip --no-cache-dir install scipy
&& apk del --purge -r build_dependencies
# && rm -rf /tmp/build
# && rm -rf /var/cache/apk/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.