Open
Description
Configuration
Docker-compose file
I am using a docker-compose.yml
file in the project root folder as follows:
version: '3.7'
services:
ssh:
container_name: ssh
depends_on:
- my-container
image: jeroenpeeters/docker-ssh
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /usr/bin/docker:/usr/bin/docker
- shared_volume:/.ssh
environment:
- FILTERS={"name":["^/my-container$$"]}
- AUTH_MECHANISM=publicKey
- AUTHORIZED_KEYS=/.ssh/authorized_keys
ports:
- 2222:22
- 8022:8022
my-container:
container_name: my-container
build:
context: .
args:
SSH_PUBLIC_KEY: ${SSH_PUBLIC_KEY}
restart: always
volumes:
- shared_volume:/var/.ssh
volumes:
shared_volume:
Dockefile
I am also using a Dockerfile
file in the project root folder:
FROM IMAGE:VERSION
ARG SSH_PUBLIC_KEY
# declare a volume at location /var/.ssh
RUN mkdir /var/.ssh
RUN echo "$SSH_PUBLIC_KEY" > /var/.ssh/authorized_keys
VOLUME /var/.ssh
EXPOSE 22
CMD bash
Behaviour
I works when opening through the browser and URL rendering the following characters in the terminal within the browser:
Connection established
###############################################################
## Docker SSH ~ Because every container should be accessible ##
###############################################################
## container | /my-container ##
###############################################################
The Errors
When accessing through the browser and URL localhost:8022
:
When connecting to port 8022 through browser it works but issues the following error within the ssh container:
TypeError: Cannot read property 'session:window-change' of undefined
at /usr/src/app/src/webserver.coffee:66:33
at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)
at next (/usr/src/app/node_modules/express/lib/router/route.js:131:13)
at Route.dispatch (/usr/src/app/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)
at /usr/src/app/node_modules/express/lib/router/index.js:277:22
at param (/usr/src/app/node_modules/express/lib/router/index.js:349:14)
at param (/usr/src/app/node_modules/express/lib/router/index.js:365:14)
at Function.process_params (/usr/src/app/node_modules/express/lib/router/index.js:410:3)
at next (/usr/src/app/node_modules/express/lib/router/index.js:271:10)
at /usr/src/app/node_modules/body-parser/lib/read.js:129:5
at invokeCallback (/usr/src/app/node_modules/raw-body/index.js:262:16)
at done (/usr/src/app/node_modules/raw-body/index.js:251:7)
at IncomingMessage.onEnd (/usr/src/app/node_modules/raw-body/index.js:307:7)
at emitNone (events.js:86:13)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
When trying to access through ssh:
I am using the command ssh -oKexAlgorithms=+curve25519-sha256 -i ~/.ssh/id_ed25519 root@localhost -p 2222 -vvv
which results in:
Unable to negotiate with 127.0.0.1 port 2222: no matching key exchange method found. Their offer: diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
Metadata
Metadata
Assignees
Labels
No labels