feat: Docker exec mode, closes #28

This commit is contained in:
Jack Wills
2023-11-14 12:38:15 +00:00
parent e1998c9fca
commit c8077bca0b
13 changed files with 397 additions and 272 deletions
+18 -4
View File
@@ -45,18 +45,32 @@ RUN cargo build --release --target $(cat /.platform)
RUN cp /usr/src/oxker/target/$(cat /.platform)/release/oxker /
################
## MUSL SETUP ##
################
FROM alpine:3.18 as MUSL_SETUP
RUN apk add --update --no-cache docker-cli upx
# Compress the docker executable, to reduce final image size
RUN upx -9 /usr/bin/docker
#############
## Runtime ##
#############
FROM scratch AS RUNTIME
FROM alpine:3.18 as RUNTIME
# Set an ENV that we're running in a container, so that the application can sleep for 250ms at start
# Set an ENV to indicate that we're running in a container
ENV OXKER_RUNTIME=container
# Copy application binary from builder image
COPY --from=BUILDER /oxker /app/
COPY --from=MUSL_SETUP /usr/bin/docker /usr/bin/
# remove sh and busybox, probably pointless
RUN rm /bin/sh /bin/busybox
# Run the application
# this is used in the application itself, to stop itself from listing itself, so DO NOT EDIT
# this is used in the application itself so DO NOT EDIT
ENTRYPOINT [ "/app/oxker"]