This is perhaps a bug, I'll open a ticket on their github to know.
Edit: I did it here.
Edit2:
Someone answered a better way of doing this on the github issue.
*
is a shell metacharacter. You need to invoke a shell for it to be expanded.
docker run somecontainer sh -c 'dpkg -i /debdir/*.deb'
!!! Forget the following but I leave it here to keep track of my reflexion steps !!!
The problem comes from the *
statement which doesn't seem to work well with the docker run dpkg
command. I tried your command inside a container (using an interactive shell) and it worked well. It looks like dpkg
is trying to install the so called ./deb-directory/*.deb
file which doesn't exist instead of installing all the .deb
files contained there.
I just implemented a workaround. Copy a .sh
script in your container, chmod +x
it and then use it as your command.
(FYI, prefer using COPY
instead of ADD
when the file isn't remotely copied. Check the best practices for writing Dockerfiles for more info.)
This is my Dockerfile for example purpose:
FROM debian:latest
MAINTAINER Vrakfall <jeremy@artphotolaurent.be>
COPY install.sh /
#debdir is a directory
COPY debdir /debdir
RUN chmod +x /install.sh
CMD ["/install.sh"]
The install.sh
(copied at the root directory) simply contains:
#!/bin/bash
dpkg -i /debdir/*.deb
And the following
docker build -t debiantest .
docker run debiantest
works well and install all the packages contained in the /debdir
directory.