jnovack / git-checkout

Basic git checkout builder or side container for workflows.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

git-checkout

A tiny builder container for pulling source from git.

Usage

This container was designed as a builder container within a multi-stage build.

## Build Container
FROM jnovack/git-checkout as builder

### Set environment variables
ENV REPO="http://github.com/jnovack/git-checkout.git"
ENV BRANCH="master"
ENV HASH="HEAD"
RUN /checkout.sh

## Application Container
FROM alpine:latest
COPY --from=builder /src /app

Environment Variables

REPO

(string, required)

A http(s):// or ssh:// git repository url.

BRANCH

(string, optional)

The name of your branch to download. (Default: master)

HASH

(string, optional)

The hash of the commit. (Default: HEAD)

SSH_KEY

(string, optional, supports _FILE)

SSH private key for authenticated repository download. SSH_KEY will always override SSH_KEY_FILE, if provided.

SSH_KEY_FILE

In the event you wish to store the key in Docker Secrets, or you want to mount in the file directly, you can set this to the file path within the container.

## Build Container
FROM jnovack/git-checkout as builder

### Set environment variables
ENV REPO="http://github.com/jnovack/git-checkout.git"
ENV BRANCH="master"
ENV HASH="HEAD"
ENV SSH_KEY_FILE="/id_rsa"
COPY ~/.ssh/id_rsa /id_rsa
RUN /checkout.sh

## Application Container
FROM alpine:latest
COPY --from=builder /src /app

About

Basic git checkout builder or side container for workflows.

License:MIT License


Languages

Language:Makefile 41.0%Language:Shell 36.6%Language:Dockerfile 22.4%