Skip to content

Commit

Permalink
Issue #5: Provide Docker Container
Browse files Browse the repository at this point in the history
Adding helper script for local Docker container builds
  • Loading branch information
dumrauf committed Oct 16, 2020
1 parent 022afe1 commit babf221
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions build_local_container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

# Stop an all errors
set -e

# Extract Git information
SOURCE_BRANCH=$(git rev-parse --abbrev-ref HEAD)
SOURCE_COMMIT=$(git rev-parse --verify HEAD)

# Build Docker tagging
NAME=dumrauf/yt2ab
TAG=$(git describe --always)
IMG=${NAME}:${TAG}
LATEST=${NAME}:latest

# Build and tag the container
docker build --build-arg SOURCE_BRANCH=${SOURCE_BRANCH} \
--build-arg SOURCE_COMMIT="${SOURCE_COMMIT}" \
-t "${IMG}" \
.
docker tag "${IMG}" "${LATEST}"

0 comments on commit babf221

Please sign in to comment.