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:
@@ -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"]
|
||||
Reference in New Issue
Block a user