Oculus/docker/reporter/Dockerfile

30 lines
1.0 KiB
Docker

# Stage 1: Build stage
FROM alpine:latest AS builder
# Install curl and bash
RUN apk add --no-cache curl bash
# Install go-glitch and oculus using their respective install.sh scripts
RUN curl -sSL https://git.nixc.us/Nixius/go-glitch/raw/branch/master/install.sh | bash && \
curl -sSL https://git.nixc.us/colin/Oculus/raw/branch/main/install.sh | bash
# Stage 2: Final stage
FROM alpine:latest
# Create an unprivileged user and group
RUN addgroup -S oculus && adduser -S oculus -G oculus
# Copy the necessary binaries from the build stage
COPY --from=builder /usr/local/bin/go-glitch /usr/local/bin/go-glitch
COPY --from=builder /usr/local/bin/oculus_main /usr/local/bin/oculus_main
COPY --from=builder /usr/local/bin/oculus_filter /usr/local/bin/oculus_filter
# Change ownership of the binaries to the unprivileged user
RUN chown oculus:oculus /usr/local/bin/go-glitch /usr/local/bin/oculus_main /usr/local/bin/oculus_filter
# Switch to the unprivileged user
USER oculus
# Set the entrypoint to the main binary
ENTRYPOINT ["/usr/local/bin/oculus_main"]