From 8b80afad965c8409a0be97f7beac3c156f4b60a2 Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Tue, 7 Jul 2020 00:23:21 -0700 Subject: [PATCH] Add Docker image to build script. Commented out. Closes #35 --- scripts/Dockerfile-build | 10 ++++++++++ scripts/build.sh | 12 ++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 scripts/Dockerfile-build diff --git a/scripts/Dockerfile-build b/scripts/Dockerfile-build new file mode 100644 index 000000000..46ca76047 --- /dev/null +++ b/scripts/Dockerfile-build @@ -0,0 +1,10 @@ +FROM golang:alpine +EXPOSE 8080 1935 +RUN mkdir /app +ADD . /app +COPY ./config-example.yaml /app/config.yaml +WORKDIR /app +RUN apk add --no-cache ffmpeg ffmpeg-libs +RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-extldflags "-static"' -o owncast . +WORKDIR /app +CMD ["/app/owncast", "-enableVerboseLogging"] \ No newline at end of file diff --git a/scripts/build.sh b/scripts/build.sh index f97972b02..3145bb891 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -70,3 +70,15 @@ done # open "https://github.com/gabek/owncast/releases/new" # open dist # fi + +# Docker build +# Must authenticate first: https://docs.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-docker-for-use-with-github-packages#authenticating-to-github-packages +# DOCKER_IMAGE="owncast-${VERSION}" +# echo "Building Docker image ${DOCKER_IMAGE}..." + +# # Change to the root directory of the repository +# cd $(git rev-parse --show-toplevel) + +# docker build -t owncast . -t="${DOCKER_IMAGE}" -f scripts/Dockerfile-build +# docker tag $DOCKER_IMAGE docker.pkg.github.com/gabek/owncast/$DOCKER_IMAGE:$VERSION +# docker push docker.pkg.github.com/gabek/owncast/$DOCKER_IMAGE:$VERSION