Sign inSign up

cowrvalera/docker-openssh-client

By cowrvalera

Updated almost 3 years ago

Alpine image with open-ssh-client (.gitlab-ci.yml and ssh-keygen)

Image
0

287

cowrvalera/docker-openssh-client repository overview

Alpine(3.18.4) image with openssh installed and set as entrypoint

The working directory is /workdir.

Repository: https://github.com/sviridenkovalera/docker-openssl/tree/v1.0.0

Examples GitLab (.gitlab-ci.yml)

image: cowrvalera/docker-openssh-client:1.0.0@sha256:bc890c26739bedc97d94c3ec52ae47d0a197df7d8bc7677713be90cf59cd37f3


#SETUP:

# SSH_PRIVATE_KEY - your secret(as file + newline at the end)
# DEPLOY_DOMAIN - your domain or ip
# DEPLOY_DIR - <project-dir-full-path>

stages:
  - deploy

deploy:
  stage: deploy
  only:
    - main
  before_script:
    - eval $(ssh-agent -s)
    - cat "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
    - mkdir -p ~/.ssh
    - chmod 700 ~/.ssh
    - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" >> ~/.ssh/config'
  script:
  
    - ssh deployuser@$DEPLOY_DOMAIN "cd $DEPLOY_DIR && docker-compose down"
    - ssh deployuser@$DEPLOY_DOMAIN "cd $DEPLOY_DIR && git pull"
    - ssh deployuser@$DEPLOY_DOMAIN "cd $DEPLOY_DIR && docker-compose up -d"

Examples Generate Keys(ed25519)

$ docker run --rm -it -v ".:/workdir/" cowrvalera/docker-openssh-client:1.0.0  ssh-keygen -t ed25519 -f /workdir/ssh_host_ed25519_key

License

MIT - see LICENSE

Tag summary

Content type

Image

Digest

sha256:bc890c267

Size

5.5 MB

Last updated

almost 3 years ago

docker pull cowrvalera/docker-openssh-client