Sign inSign up

djieno/alpine-ssh-bash

By djieno

Updated over 7 years ago

Image
0

1.0K

djieno/alpine-ssh-bash repository overview

This docker image is based on the standard Alpine image with additional ssh and bash installed. This way it's easy to use it as a gitlab runner task to be able to login into other servers by ssh in your (Gitlab) pipeline.

Dockerfile

user@server:~/repos/alpine-ssh-bash$ cat Dockerfile.amd64 
FROM alpine:latest
RUN apk add --no-cache --update openssh-client bash

Just add the Runner variable 'SSH_KEY_FILE' under settings / CI/CD / Environment variables.

Below a snipped of a .gitlab-ci.yml stage

tb_k8s:
  stage: test_build
  image: djieno/alpine-ssh-bash:amd64
  tags:
    - kubernetes
  script:
    - eval $(ssh-agent -s)
    - bash -c 'ssh-add <(echo "$SSH_KEY_FILE")'
    - ssh -o StrictHostKeyChecking=no [email protected] "GIT_SSH_COMMAND='ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i 
 ~/.ssh/someprivkey' git -C ~/somerepo pull"
    - ssh -o StrictHostKeyChecking=no [email protected] "uvt-kvm create testbox1 --memory 4096 --disk 6 --cpu 2 --run-script-once ~/somescript.sh"

Tag summary

Content type

Image

Digest

Size

4.9 MB

Last updated

over 7 years ago

docker pull djieno/alpine-ssh-bash