You can add this to your docker-compose.yml (assuming your user inside container is root):
volumes:
- ~/.ssh:/root/.ssh
Also you can check for more advanced solution with ssh agent (I did not tried it myself)
More Related Contents:
- Docker: How to clear the logs properly for a Docker container?
- Volume binding using docker compose on Windows
- Is it safe to clean docker/overlay2/
- Docker Compose – Share named volume between multiple containers
- How to use local docker images with Minikube?
- How to make ssh receive the password from stdin
- React app exiting in docker container with exit code 0
- ng serve not working in Docker container
- Docker-Compose persistent data MySQL
- Automating command/script execution using PuTTY
- Transferring files over SSH [closed]
- How to correctly link php-fpm and Nginx Docker containers?
- How can I use a local file on container?
- How to access SSH keys for a Google Cloud Platform Compute Engine VM instance?
- Timeout when running xcodebuild tests under Xcode 6 via SSH
- Docker Compose – How to execute multiple commands?
- Using expect to pass a password to ssh
- Communications link failure , Spring Boot + MySql +Docker + Hibernate
- What is the alternative to condition form of depends_on in docker-compose Version 3?
- How to pass ARG value to ENTRYPOINT?
- How can I use environment variables in docker-compose?
- Unable to negotiate with XX.XXX.XX.XX: no matching host key type found. Their offer: ssh-dss
- How to restart a single container with docker-compose
- How to connect locally hosted MySQL database with the docker container
- How to pass arguments to a Dockerfile?
- Pass argument to docker compose
- Docker-compose exit code is 137 when there is no OOM exception
- Spring Docker container cannot access Postgres Docker container
- django cannot connect mysql in docker-compose
- how to get docker-compose to use the latest image from repository