Skip to content

Latest commit

 

History

History
118 lines (89 loc) · 4.14 KB

File metadata and controls

118 lines (89 loc) · 4.14 KB

CONCOURSE DEPLOY DOCKER RESOURCE

Tag Latest codeclimate Issue Count Docker Pulls MIT License jeffdecola.com

A concourse resource to deploy a dockerhub docker image on a machine via ssh.

Table of Contents

Documentation and Reference

OVERVIEW

A concourse resource to deploy a docker image from dockerhub on a machine via ssh.

HOW TO USE

To use this resource, you will provide the following dockerhub information in the pipeline,

  • username: jeffdecola
  • password: ((dockerhub_password))

Then define the machine where you want and what dockerhub image to deploy,

  • DOCKER_HOST_IP: '192.168.20.124'
  • DOCKER_HOST_PORT: '22'
  • DOCKER_HOST_USER: 'jeffdecola'
  • DOCKER_HOST_RUN_PRIVILEGED_MODE: 'true'
  • DOCKER_HOST_SSH_PRIVATE_KEY_FILE: {{docker_host_ssh_private_key_file}}
  • DOCKER_IMAGE_TO_DEPLOY: 'jeffdecola/crypto-miner-manager'

The resource is,

resource_types:

  - name: deploy-docker
    type: docker-image
    source:
      repository: jeffdecola/concourse-deploy-docker-resource
      tag: latest

resources:

  - name: test-resource-deploy-docker
    type: deploy-docker
    icon: docker
    source:
      username: jeffdecola
      password: ((dockerhub_password))

And to use as a put,

- put: test-resource-deploy-docker
  params:
    DOCKER_HOST_IP: '192.168.20.124'
    DOCKER_HOST_PORT: '22'
    DOCKER_HOST_USER: 'jeffdecola'
    DOCKER_HOST_RUN_PRIVILEGED_MODE: 'true'
    DOCKER_HOST_SSH_PRIVATE_KEY_FILE: {{jeffs_mbp_docker_host_ssh_private_key}}
    DOCKER_IMAGE_TO_DEPLOY: 'jeffdecola/crypto-miner-manager'

HOW I BUILT AND PUSHED THIS RESOURCE (REFERENCE)

Refer to my concourse-resource-template on how I built this resource.

To build.sh using the Dockerfile,

cd build-resource-using-bash/build
sh build-resource.sh

Note how a concourse base image is used to build the resource.

To push.sh the resource docker image to dockerhub,

cd build-resource-using-bash/push
sh push.sh

You can check this docker image,

docker images jeffdecola/concourse-deploy-docker-resource
docker run --name concourse-deploy-docker-resource -dit jeffdecola/concourse-deploy-docker-resource
docker exec -i -t concourse-deploy-docker-resource /bin/bash
docker logs concourse-deploy-docker-resource
docker rm -f concourse-deploy-docker-resource