Skip to content

Basic git checkout builder or side container for workflows.

License

Notifications You must be signed in to change notification settings

jnovack/git-checkout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Topics

Resources

License

Stars

Watchers

Forks