feat: exec mode improvements

Use Bollard library to exec in pure Rust.

`--use-cli` cli arg, will then only try to exec into containers using
Docker.

Only try to exec into a container if the state == Running.
This commit is contained in:
Jack Wills
2023-11-17 02:49:30 +00:00
parent 28b0315dd7
commit 0e5ee143b0
15 changed files with 477 additions and 142 deletions
+2 -17
View File
@@ -45,32 +45,17 @@ 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 alpine:3.18 as RUNTIME
FROM scratch as RUNTIME
# Set an ENV to indicate that we're running in a container
ENV OXKER_RUNTIME=container
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 so DO NOT EDIT
ENTRYPOINT [ "/app/oxker"]
ENTRYPOINT [ "/app/oxker"]