Giter Club home page Giter Club logo

Comments (3)

rfay avatar rfay commented on May 30, 2024 7

docker-compose v3 doesn't support the volumes-from key any more, so the instructions from that point of view are getting obsolete.

I followed the instructions using the top-level "volumes" key, Here's a full working example:

Of course, the adding-of-the-keys manually as outlined in the README is still required.

I used kroniak/ssh-client for the test images just because it was an easy image that had the ssh client installed for testing.

version: '3'

volumes:
  dot_ssh:
  socket_dir:

services:
  ssh-agent:
    container_name: ssh-agent
    image: nardeas/ssh-agent:latest
    volumes:
      - "dot_ssh:/root/.ssh"
      - "socket_dir:/.ssh-agent"
    environment:
      - SSH_AUTH_SOCK=/.ssh-agent/socket
  ssh1:
    container_name: ssh1
    image: kroniak/ssh-client:latest
    command: 'sh -c "tail -f /dev/null"'
    volumes:
      - "dot_ssh:/root/.ssh"
      - "socket_dir:/.ssh-agent"
    environment:
      - SSH_AUTH_SOCK=/.ssh-agent/socket
  ssh2:
    container_name: ssh2
    image: kroniak/ssh-client:latest
    command: 'sh -c "tail -f /dev/null"'
    volumes:
      - "dot_ssh:/root/.ssh"
      - "socket_dir:/.ssh-agent"
    environment:
      - SSH_AUTH_SOCK=/.ssh-agent/socket

from ssh-agent.

cocox avatar cocox commented on May 30, 2024 1

I have written a PR for passwordless using docker secrets. This is my compose v3 file..

version: "3.1"

services:
    ssh-agent-load:
        image: ssh-agent
        environment:
            DEBUG: 1
        depends_on:
            - ssh-agent
        volumes:
            - ~/.ssh:/.ssh
            - sshagent:/.ssh-agent
        command: ssh-add-pass git_key /run/secrets/ssh_key
        secrets:
           - ssh_key
    php:
        image: php
        volumes:
            - sshagent:/.ssh-agent
        depends_on:
            - ssh-agent-load
        entrypoint: autoaggregate
    ssh-agent:
        image: ssh-agent
        volumes:
            - sshagent:/.ssh-agent
    ssh-agent-list:
        image: ssh-agent
        environment:
            DEBUG: 1
        depends_on:
            - ssh-agent
        volumes:
            - sshagent:/.ssh-agent
        command: ssh-add-list

secrets:
    ssh_key:
        file: ssh_keytxt

volumes:
    sshagent:

from ssh-agent.

nardeas avatar nardeas commented on May 30, 2024

Thank you! I will look more into this. I haven't had any extra time past few months to focus on this, but since a lot of people find it useful I will focus more on it.

This could be added as compose example for sure!

from ssh-agent.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.