How to connect to macos and execute a script from docker image

Background: I currently have jenkins installed on my macos and I use it to trigger shell script at regular intervals. Shell script is in my mac and all jenkins does is call the shell script. Now I’m trying to move to Concourse and do the same with Concourse (that is call shell script which is in my mac at regular intervals). I’m very new to Docker, Concourse and still trying to understand and do things in a better way

Since everything in concourse is container based. I’m trying to ssh from container to mac and execute shell script on my mac. I’m trying to use ssh-keygen and connect to mac from container. I wrote a bash script to connect to mac from container but it doesn’t work

connect.sh

#!/usr/bin/env bash

ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa
ssh-copy-id [email protected]

pipeline.yaml file

---
resources:
  - name: repo
    type: git
    source:
      uri: https://github.com/raamojirao/reports.git
      branch: master

jobs:
  - name: some-name
    public: true
    plan:
      - get: repo
      - task: some-task
        config:
          platform: linux
          image_resource:
            type: docker-image
            source: {repository: ubuntu}

          inputs:
            - name: repo

          run:
            path: repo/connect.sh

I get the following error message
repo/connect.sh: line 3: ssh-keygen: command not found
repo/connect.sh: line 4: ssh-copy-id: command not found

The docker-image I used is ubuntu. Is ssh-keygen not found in ubuntu? If I had to create a custom image with ssh-keygen, how do I pass that image to the pipeline.yml file. Please help! I understand I’ve asked too many questions. I’m new to Docker and trying to understand so any help is very appreciated.

Source: StackOverflow