docker-web-gui icon indicating copy to clipboard operation
docker-web-gui copied to clipboard

pin base image, add python and docker dependencies into the container

Open sergueik opened this issue 2 years ago • 3 comments

There is no use of the host's docker binary inside the alpine image - it will nnot be runnable. Instead docker and python need to be added via apk.

sergueik avatar Aug 14 '22 01:08 sergueik

There is no use of the host's docker binary inside the alpine image - it will nnot be runnable. Instead docker and python need to be added via apk.

@sergueik Thank you for creating the pull request!

Can you add some more details and how to reproduce the problem that you have faced?

rakibtg avatar Aug 28 '22 15:08 rakibtg

  1. host os ubuntu
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.6 LTS
Release:        18.04
Codename:       bionic
  1. attempt to map host docker binary into container
 which docker
/usr/bin/docker	

run pinned verison node alpine container

docker run -it -v  /usr/bin/docker:/usr/bin/docker node:8.12-alpine sh
Unable to find image 'node:8.12-alpine' locally
8.12-alpine: Pulling from library/node
4fe2ade4980c: Already exists
eeb7d76f44e7: Pull complete
e35f88fcc259: Pull complete
Digest: sha256:d75742c5fd41261113ed4706f961a21238db84648c825a5126ada373c361f46e
Status: Downloaded newer image for node:8.12-alpine
Digest: sha256:d75742c5fd41261113ed4706f961a21238db84648c825a5126ada373c361f46e
Status: Downloaded newer image for node:8.12-alpine

in the container see if docker is runnable

/ #
/ # ldd /usr/bin/docker
        /lib64/ld-linux-x86-64.so.2 (0x7fd0646eb000)
        libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x7fd0646eb000)
        libdl.so.2 => /lib64/ld-linux-x86-64.so.2 (0x7fd0646eb000)
        libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7fd0646eb000)
Error relocating /usr/bin/docker: __vfprintf_chk: symbol not found

Error relocating /usr/bin/docker: __fprintf_chk: symbol not found

try to run it anyway

/usr/bin/docker -v
sh: /usr/bin/docker: not found

of course installing docker via apk helps

but one has to staop the the container which has the host's docker

rm -f /usr/bin/docker

rm: can't remove '/usr/bin/docker': Resource busy
exit
docker run -it -v /var/run/docker.sock:/var/run/docker.sock node:8.12-alpine sh

in the container install docker and list hosts images:

/ # apk add docker
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
(1/9) Installing ca-certificates (20191127-r2)
(2/9) Installing libmnl (1.0.4-r0)
(3/9) Installing jansson (2.11-r0)
(4/9) Installing libnftnl-libs (1.1.1-r0)
(5/9) Installing iptables (1.6.2-r0)
(6/9) Installing device-mapper-libs (2.02.178-r0)
(7/9) Installing libltdl (2.4.6-r5)
(8/9) Installing libseccomp (2.4.2-r2)
(9/9) Installing docker (18.06.1-r0)
Executing docker-18.06.1-r0.pre-install
Executing busybox-1.28.4-r1.trigger
Executing ca-certificates-20191127-r2.trigger
OK: 183 MiB in 24 packages
 docker container ls
CONTAINER ID        IMAGE               COMMAND             CREATED              STATUS              PORTS               NAMES
78ac98862051        node:8.12-alpine    "sh"                About a minute ago   Up About a minute 

sergueik avatar Aug 28 '22 17:08 sergueik

Hi @sergueik! Many thanks for the PR! A new update should fix this issue already, please pull latest changes from master and let me know if the fix works or not.

rakibtg avatar Jun 01 '24 01:06 rakibtg