forked from xteve-project/xTeVe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request xteve-project#2 from SenexCrenshaw:Docker-Dev
xteve release from github instead of building
- Loading branch information
Showing
2 changed files
with
100 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
# First stage. Building a binary | ||
# ----------------------------------------------------------------------------- | ||
|
||
# Base image for builder is debian 11 with golang 1.18+ pre-installed | ||
#FROM golang:1.18.1-bullseye AS builder | ||
FROM golang:bullseye AS builder | ||
|
||
# Download the source code | ||
# Uncomment the below line to force git pull (no cache) | ||
#ADD "https://www.random.org/cgi-bin/randbyte?nbytes=10&format=h" skipcache | ||
RUN git clone https://github.com/SenexCrenshaw/xTeVe.git /src | ||
WORKDIR /src | ||
|
||
# Install dependencies | ||
RUN go mod download | ||
|
||
# Compile | ||
RUN go build xteve.go | ||
|
||
# Second stage. Creating an image | ||
# ----------------------------------------------------------------------------- | ||
|
||
# Base image | ||
FROM alpine:latest | ||
|
||
ARG BUILD_DATE | ||
ARG VCS_REF | ||
ARG XTEVE_PORT=34400 | ||
ARG XTEVE_VERSION | ||
|
||
LABEL org.opencontainers.image.created="{$BUILD_DATE}" \ | ||
org.opencontainers.image.url="https://hub.docker.com/r/SenexCrenshaw/xteve/" \ | ||
org.opencontainers.image.source="https://github.com/SenexCrenshaw/xTeVe" \ | ||
org.opencontainers.image.version="{$XTEVE_VERSION}" \ | ||
org.opencontainers.image.revision="{$VCS_REF}" \ | ||
org.opencontainers.image.vendor="SenexCrenshaw" \ | ||
org.opencontainers.image.title="xTeVe" \ | ||
org.opencontainers.image.description="Dockerized fork of xTeVe by SenexCrenshaw" \ | ||
org.opencontainers.image.authors="SenexCrenshaw SenexCrenshaw@gmail.com" | ||
|
||
ENV XTEVE_BIN=/home/xteve/bin | ||
ENV XTEVE_CONF=/home/xteve/conf | ||
ENV XTEVE_HOME=/home/xteve | ||
ENV XTEVE_TEMP=/tmp/xteve | ||
|
||
# Add binary to PATH | ||
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$XTEVE_BIN | ||
|
||
# Set working directory | ||
WORKDIR $XTEVE_HOME | ||
|
||
# Update package lists | ||
RUN apk update | ||
RUN apk upgrade | ||
|
||
# Install CA certificates | ||
RUN apk add --no-cache ca-certificates | ||
|
||
# Timezone (TZ) | ||
RUN apk update && apk add --no-cache tzdata | ||
ENV TZ=America/New_York | ||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone | ||
|
||
# Add ffmpeg and vlc | ||
RUN apk add ffmpeg | ||
RUN apk add vlc | ||
|
||
# Creat bin dir | ||
RUN mkdir $XTEVE_BIN | ||
|
||
# Copy built binary from builder image | ||
COPY --from=builder [ "/src/xteve", "${XTEVE_BIN}/" ] | ||
|
||
# Set binary permissions | ||
RUN chmod +rx $XTEVE_BIN/xteve | ||
|
||
# Create XML cache directory | ||
RUN mkdir $XTEVE_HOME/cache | ||
|
||
# Create working directories for xTeVe | ||
RUN mkdir $XTEVE_CONF | ||
RUN chmod a+rwX $XTEVE_CONF | ||
RUN mkdir $XTEVE_TEMP | ||
RUN chmod a+rwX $XTEVE_TEMP | ||
|
||
RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2 | ||
|
||
# Configure container volume mappings | ||
VOLUME $XTEVE_CONF | ||
VOLUME $XTEVE_TEMP | ||
|
||
# Expose Port | ||
EXPOSE 34400 | ||
|
||
# Run the xTeVe executable | ||
ENTRYPOINT ${XTEVE_BIN}/xteve -port=${XTEVE_PORT} -config=${XTEVE_CONF} |