Can't exec into container
bieron opened this issue · comments
I'm using dockerised version of dockly, and I have multiple containers running, all of them have both sh and bash installed. Other dockly features work well.
Expected Behavior
A shell inside a container is opened
Actual Behavior
ERROR spawnsync docker ENOENT
Steps to Re-produce the Problem
- select a container and press "l"
Context
- Operating System: ubuntu 16.04
- Node.js version (run
node --version
): as in librantal/dockly:latest - Package version: as in librantal/dockly:latest
- Docker version (run
docker --version
): Docker version 18.09.4, build d14af54 - Is docker installed locally? yes
- Do you have containers created? yes
- Does this file exists
/var/run/docker.sock
? yes - Output of
docker info
:
Containers: 24
Running: 24
Paused: 0
Stopped: 0
Images: 581
Server Version: 18.09.4
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: bb71b10fd8f58240ca47fbb579b9d1028eea7c84
runc version: 2b18fe1d885ee5083ef9f0838fee39b62d653e30
init version: fec3683
Security Options:
apparmor
seccomp
Profile: default
Kernel Version: 4.18.0-041800-lowlatency
Operating System: Ubuntu 16.04.6 LTS
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 15.55GiB
Name: sokrates
ID: 2ZT7:CRKC:PFS2:D4UT:HMGU:5Y4N:YEZK:CDPW:IE7J:RZS7:VYHF:DEGN
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Username: jbieron
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine
WARNING: No swap limit support
Ok I see why that's not actually working... the code that is responsible to connect over a shell is this:
cp.execFileSync('docker', ['exec', '-it', containerId, '/bin/sh'], {
It's trying to spawn docker
to get it connected to the container but we don't have docker
as a utility installed inside of dockly's base image. We're using alpine which is great because it's small but it definitely doesn't have docker installed inside it.
Looking at the DIND (Docker In Docker) image (https://hub.docker.com/_/docker) it seems to be small as well so perhaps we could just add it to the alpine image. Here's a reference to the Dockerfile that pulls it in: https://github.com/docker-library/docker/blob/master/18.06/Dockerfile
🎉 This issue has been resolved in version 3.10.4 🎉
The release is available on:
Your semantic-release bot 📦🚀