feat: self dockerisation dev Dockefile

This commit is contained in:
Jack Wills
2022-09-06 14:38:29 +00:00
parent d6e2026eec
commit 211f481c38
4 changed files with 16 additions and 2 deletions
@@ -82,7 +82,6 @@ jobs:
--push \ --push \
-f containerised/Dockerfile . -f containerised/Dockerfile .
- name: Release - name: Release
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
with: with:
+1
View File
@@ -6,6 +6,7 @@ FROM --platform=linux/amd64 rust:slim as builder
ARG TARGETARCH ARG TARGETARCH
# These are build platform depandant, but will be ignored if not needed
ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER="aarch64-linux-gnu-gcc" ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER="aarch64-linux-gnu-gcc"
ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-C target-feature=+crt-static -C link-arg=-lgcc" ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-C target-feature=+crt-static -C link-arg=-lgcc"
ENV CARGO_TARGET_ARM_UNKNOWN_LINUX_MUSLEABIHF_LINKER="arm-linux-gnueabihf-ld" ENV CARGO_TARGET_ARM_UNKNOWN_LINUX_MUSLEABIHF_LINKER="arm-linux-gnueabihf-ld"
+15
View File
@@ -0,0 +1,15 @@
#############
## Runtime ##
#############
FROM alpine:latest AS runtime
# Copy application binary from builder image
COPY ./target/x86_64-unknown-linux-musl/release/oxker /usr/local/bin
COPY ./containerised/start_oxker.sh ./
# Run the application
ENTRYPOINT [ "./start_oxker.sh"]
# One liner to build musl program, build docker image, then execute the image
# cargo build --release --target x86_64-unknown-linux-musl && docker build -t oxker_dev -f containerised/Dockerfile_dev . && docker run --rm -it --volume /var/run/docker.sock:/var/run/docker.sock:ro oxker_dev
-1
View File
@@ -1,5 +1,4 @@
#!/bin/sh #!/bin/sh
# Used in Docker build to set platform dependent variables # Used in Docker build to set platform dependent variables
case $TARGETARCH in case $TARGETARCH in