Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jnovack/git-checkout
Basic git checkout builder or side container for workflows.
https://github.com/jnovack/git-checkout
builder-container docker git
Last synced: 15 days ago
JSON representation
Basic git checkout builder or side container for workflows.
- Host: GitHub
- URL: https://github.com/jnovack/git-checkout
- Owner: jnovack
- License: mit
- Created: 2017-07-06T22:06:49.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-09-15T12:19:33.000Z (about 4 years ago)
- Last Synced: 2024-08-09T02:18:12.368Z (4 months ago)
- Topics: builder-container, docker, git
- Language: Makefile
- Homepage:
- Size: 11.7 KB
- Stars: 8
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- jimsghstars - jnovack/git-checkout - Basic git checkout builder or side container for workflows. (Makefile)
README
# 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](https://docs.docker.com/engine/userguide/eng-image/multistage-build/).```Dockerfile
## 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.```Dockerfile
## 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
```