Comments (8)
Hi, I tried the steps mentioned in your issue report, but when I execute these steps I can actually ssh into the container. I see in the output of the webinterface you posted that you are trying to ssh into a container named 'php-debug-test2' while the container in your example is called 'sshd-less '.
Are you sure that container 'php-debug-test2' has bash? This is problem can actually manifest if bash is not present, or not present on the PATH.
By default Docker-SSH tries to start a shell with the bash
command. If your container has bash on a different path, or uses a different shell (for example sh
) you can configure Docker-SSH to use that shell by specifying the CONTAINER_SHELL environment variable like so:
docker run -e CONTAINER_SHELL=/bin/sh -e CONTAINER=sshd-less -e AUTH_MECHANISM=noAuth \ --name sshd-php-debug-test -p 2222:22 -p 8022:8022 --rm \ -v /var/run/docker.sock:/var/run/docker.sock -v $(which docker):/usr/bin/docker \ jeroenpeeters/docker-ssh
First try the following to check if the container has bash or sh.
docker exec -ti sshd-less which bash
or docker exec -ti sshd-less which sh
Let me know how it goes.
from docker-ssh.
Hey, thanks for the lightning fast reply!
And yes, there were typos. I wanted to clean up my naming mess with things like "test2" and such but it didn't work out, did it? :)
Yes, the container has bash, verified by:
> docker exec -ti php-debug-test2 which bash
/bin/bash
But still no luck. It the same as described above. I also made sure only those two containers were running.
from docker-ssh.
As of the moment I can only think of one and that's a problem with mounting the docker socket and binary and some/one missing dependencies on the guest.
After exec'ing into the docker-ssh container and trying to exec into my ssh-less conatainer I get the following error:
root@bd6d89f564a2:/lib/x86_64-linux-gnu# docker exec -ti nostalgic_meitner sh
docker: /lib/x86_64-linux-gnu/libdevmapper.so.1.02.1: version `DM_1_02_97' not found (required by docker)
(nostalgic_meitner in that case is a running alpine conatiner)
The same error occurs by just calling docker
from inside the running docker-ssh container.
Now, my docker env is as dfollows:
> docker version
Client:
Version: 1.9.1
API version: 1.21
Go version: go1.4.2
Git commit: a34a1d5
Built: Fri Nov 20 13:20:08 UTC 2015
OS/Arch: linux/amd64
Server:
Version: 1.9.1
API version: 1.21
Go version: go1.4.2
Git commit: a34a1d5
Built: Fri Nov 20 13:20:08 UTC 2015
OS/Arch: linux/amd64
from docker-ssh.
Well, I fixed it or more precisely found a workaround by mounting the library into the docker-ssh container alongside the docker socket and binary which results in the following run statement:
docker run \
-e CONTAINER_SHELL=sh \
-e CONTAINER=nostalgic_meitner \
-e AUTH_MECHANISM=noAuth \
--name sshd-docker \
-p 2222:22 \
-p 8022:8022 \
--rm \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $(which docker):/usr/bin/docker \
-v /lib/x86_64-linux-gnu/libdevmapper.so.1.02.1:/lib/x86_64-linux-gnu/libdevmapper.so.1.02.1 \
jeroenpeeters/docker-ssh
Now it works like a charm and I will close this issue!
As an improvement I would suggest using a docker-in-docker container instead of mounting the executable and socket (and now the device mapper lib). Maybe I will give it a try.
from docker-ssh.
Could you please pull the latest version and try it without mapping libdevmapper. I changed the image to be based on Alpine with all the Docker binaries/libraries included. The image itself is also much smaller. For me it is now enough to only map the docker socket into the container.
Please give it a try and let me know how it went.
from docker-ssh.
My request is still current, however I have completely removed all Docker binaries from the image. I changed the implementation to directly connect to the Docker engine using the API over the Docker socket. There is no need to map any binaries anymore except for the Docker socket.
from docker-ssh.
Hey, I'm back from some vacation days... I'll give it a try asap. BTW I also tried to build an image based on alpine, added glibc and stuff but it wouldn't work. So I'm curious!
from docker-ssh.
Did you manage to try it again?
from docker-ssh.
Related Issues (20)
- How to get this to work with latest Alpine image? HOT 1
- TypeError: Cannot read property 'length' of undefined HOT 4
- id_rsa is a private key... HOT 3
- Why is there a private RSA key in this repository? HOT 1
- tcp forwarding is not allowed
- error: Forever detected script exited with code: 1
- Does publicKey authentication work for Web Terminal also?
- Why is container deprecated
- Commented authorized_keys file bug
- Malformed packet error with x2goclient
- Type error: resizeTerm is not a function HOT 2
- closed by remote host HOT 7
- Usage as a reverse ssh tunnel HOT 1
- Webconsole timeout
- invalid reference format: repository name must be lowercase
- Is there a Fork which has evolved further? HOT 1
- Web terminal not working HOT 1
- Works but issues errors
- VSCode and Remote-SSH Extension HOT 1
- Is this unmaintained
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-ssh.