From ed80a58feeb8c71d6144417a28c994337cd51414 Mon Sep 17 00:00:00 2001
From: Jack Wills <32690432+mrjackwills@users.noreply.github.com>
Date: Mon, 5 Sep 2022 13:07:44 +0000
Subject: [PATCH 1/7] feat: first working alpine docker container of self
---
Dockerfile | 120 +++++++++++++------------------------------------
start_oxker.sh | 6 +--
2 files changed, 35 insertions(+), 91 deletions(-)
diff --git a/Dockerfile b/Dockerfile
index 30f795e..8b8e972 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,103 +1,47 @@
-# FROM debian:bullseye-slim
-# FROM
-FROM alpine:latest
-# FROM scratch
+#############
+## Builder ##
+#############
-# DOCKER_GUID=1000 \
- # DOCKER_UID=1000 \
- # DOCKER_TIME_CONT=America \
- # DOCKER_TIME_CITY=New_York \
-# ARG DOCKER_APP_USER=oxker \
- # DOCKER_APP_GROUP=docker
+FROM rust:1.63.0-slim as builder
-# ENV TZ=${DOCKER_TIME_CONT}/${DOCKER_TIME_CITY}
+WORKDIR /usr/src
-# RUN apt-get update \
- # && apt-get install -y ca-certificates wget \
- # && update-ca-certificates \
-# RUN groupadd ${DOCKER_APP_GROUP}
-# RUN useradd --no-create-home --no-log-init ${DOCKER_APP_USER}
- # && mkdir /healthcheck /logs \
- # && chown ${DOCKER_APP_USER}:${DOCKER_APP_GROUP} /logs
+# Create blank project
+RUN USER=root cargo new oxker
-WORKDIR /app
+# We want dependencies cached, so copy those first.
+COPY Cargo.toml Cargo.lock /usr/src/oxker/
-# COPY --chown=${DOCKER_APP_USER}:${DOCKER_APP_GROUP} docker/healthcheck/health_api.sh /healthcheck
+# Set the working directory
+WORKDIR /usr/src/oxker
-# Copy from local release destination
-# COPY --chown=${DOCKER_APP_USER} target/release/oxker /app/
-# COPY target/release/oxker .
-# RUN mkdir app
-COPY /target/x86_64-unknown-linux-musl/release/oxker ./
-COPY ./start_oxker.sh ./
-RUN chmod +x /app/start_oxker.sh
+## Install target platform (Cross-Compilation) --> Needed for Alpine
+RUN rustup target add x86_64-unknown-linux-musl
-# Use an unprivileged user
-# USER ${DOCKER_APP_USER}
-ENV RUST_BACKTRACE=full
-# ENTRYPOINT ["./oxker" ]
-# CMD [ "./oxker"]
-ENTRYPOINT ["/app/start_oxker.sh"]
+# This is a dummy build to get the dependencies cached.
+RUN cargo build --target x86_64-unknown-linux-musl --release
-# docker run --rm -ti \
-# --name=ctop \
-# --volume /var/run/docker.sock:/var/run/docker.sock:ro \
-# # quay.io/vektorlab/ctop:latest
+# Now copy in the rest of the sources
+COPY src /usr/src/oxker/src/
+## Touch main.rs to prevent cached release build
+RUN touch /usr/src/oxker/src/main.rs
-# docker run --rm -it --volume /var/run/docker.sock:/var/run/docker.sock:ro oxker
+# This is the actual application build.
+RUN cargo build --target x86_64-unknown-linux-musl --release
-# docker run --rm -it --volume /var/run/docker.sock:/var/run/docker.sock:ro ghcr.io/mrjackwills/oxker:latest
-# could get arch, and then download appropoatley from github?
+#############
+## Runtime ##
+#############
-# FROM rust:latest as cargo-build
+FROM alpine:latest AS runtime
-# WORKDIR /build
-# ENV RUSTFLAGS="-C target-feature=+crt-static"
+# Copy application binary from builder image
+COPY --from=builder /usr/src/oxker/target/x86_64-unknown-linux-musl/release/oxker /usr/local/bin
+COPY start_oxker.sh ./
+RUN chmod +x /start_oxker.sh
-# COPY Cargo* ./build
-# COPY src/ ./build
+# Run the application
+ENTRYPOINT [ "./start_oxker.sh"]
-# RUN cargo build --release --target x86_64-unknown-linux-gnu
-
-# #####################################
-
-
-# #####################################
-
-# FROM scratch
-
-# COPY --from=cargo-build /build/target/x86_64-unknown-linux-gnu/release/oxker /oxker
-
-# ENTRYPOINT [ "/oxker" ]
-
-# FROM rust:latest AS build
-# WORKDIR /oxker_build
-
-# # Download the target for static linking.
-# RUN rustup target add x86_64-unknown-linux-musl
-
-# # Create a dummy project and build the app's dependencies.
-# # If the Cargo.toml or Cargo.lock files have not changed,
-# # we can use the docker build cache and skip these (typically slow) steps.
-# RUN USER=root cargo new oxker --bin
-# WORKDIR /oxker_build
-# COPY Cargo.toml Cargo.lock ./
-# # CMD ["sleep", "6000"]
-
-# # RUN cargo build --release
-
-# # Copy the source and build the application.
-# COPY src ./src/
-# RUN cargo install --target x86_64-unknown-linux-musl --path .
-
-# # Copy the statically-linked binary into a scratch container.
-# FROM scratch
-# COPY --from=build /oxker_build/bin/oxker .
-# # USER 1000
-# CMD ["./oxker"]
-
-# cross build --target x86_64-unknown-linux-musl --release
-
-# rustup target add x86_64-unknown-linux-musl
-# cargo build --release --target=x86_64-unknown-linux-musl
\ No newline at end of file
+# docker run --rm -it --volume /var/run/docker.sock:/var/run/docker.sock:ro oxker
\ No newline at end of file
diff --git a/start_oxker.sh b/start_oxker.sh
index 10a03d1..d0563c0 100755
--- a/start_oxker.sh
+++ b/start_oxker.sh
@@ -1,7 +1,7 @@
#!/bin/sh
set -e
-# No idea why this is sloving my issue, or even where the issue is originally coming from
-sleep 1
+# No idea why this is solving my issue, or even where the issue is originally coming from
+sleep .1
-exec ./oxker "$@"
\ No newline at end of file
+exec /usr/local/bin/oxker "$@"
\ No newline at end of file
From c2910aaef34cc70d4217564dba7661ef42010c8c Mon Sep 17 00:00:00 2001
From: Jack Wills <32690432+mrjackwills@users.noreply.github.com>
Date: Mon, 5 Sep 2022 22:05:24 +0000
Subject: [PATCH 2/7] feat: self containerisation
Build oxker images, for x86, arm64v8, and armv6, and publish to Docker Hub
---
Dockerfile | 47 ---------------
README.md | 8 ++-
containerised/DOCKERHUB_README.md | 26 +++++++++
containerised/Dockerfile | 58 +++++++++++++++++++
containerised/create_docker_images.sh | 10 ++++
containerised/platform.sh | 19 ++++++
.../start_oxker.sh | 0
7 files changed, 120 insertions(+), 48 deletions(-)
delete mode 100644 Dockerfile
create mode 100644 containerised/DOCKERHUB_README.md
create mode 100644 containerised/Dockerfile
create mode 100644 containerised/create_docker_images.sh
create mode 100644 containerised/platform.sh
rename start_oxker.sh => containerised/start_oxker.sh (100%)
diff --git a/Dockerfile b/Dockerfile
deleted file mode 100644
index 8b8e972..0000000
--- a/Dockerfile
+++ /dev/null
@@ -1,47 +0,0 @@
-#############
-## Builder ##
-#############
-
-FROM rust:1.63.0-slim as builder
-
-WORKDIR /usr/src
-
-# Create blank project
-RUN USER=root cargo new oxker
-
-# We want dependencies cached, so copy those first.
-COPY Cargo.toml Cargo.lock /usr/src/oxker/
-
-# Set the working directory
-WORKDIR /usr/src/oxker
-
-## Install target platform (Cross-Compilation) --> Needed for Alpine
-RUN rustup target add x86_64-unknown-linux-musl
-
-# This is a dummy build to get the dependencies cached.
-RUN cargo build --target x86_64-unknown-linux-musl --release
-
-# Now copy in the rest of the sources
-COPY src /usr/src/oxker/src/
-
-## Touch main.rs to prevent cached release build
-RUN touch /usr/src/oxker/src/main.rs
-
-# This is the actual application build.
-RUN cargo build --target x86_64-unknown-linux-musl --release
-
-#############
-## Runtime ##
-#############
-
-FROM alpine:latest AS runtime
-
-# Copy application binary from builder image
-COPY --from=builder /usr/src/oxker/target/x86_64-unknown-linux-musl/release/oxker /usr/local/bin
-COPY start_oxker.sh ./
-RUN chmod +x /start_oxker.sh
-
-# Run the application
-ENTRYPOINT [ "./start_oxker.sh"]
-
-# docker run --rm -it --volume /var/run/docker.sock:/var/run/docker.sock:ro oxker
\ No newline at end of file
diff --git a/README.md b/README.md
index db64461..284f335 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
-
+
@@ -20,6 +20,12 @@
+## Run via Docker
+
+Now published on Docker Hub, with images built for `linux/amd64`, `linux/arm64v8`, and `linux/armv6`
+
+`docker run --rm -it --volume /var/run/docker.sock:/var/run/docker.sock:ro mrjackwills/oxker:latest`
+
## Download & install
diff --git a/containerised/DOCKERHUB_README.md b/containerised/DOCKERHUB_README.md
new file mode 100644
index 0000000..d8ef143
--- /dev/null
+++ b/containerised/DOCKERHUB_README.md
@@ -0,0 +1,26 @@
+
+
+
+
+
+
oxker
+
+ A simple tui to view & control docker containers
+
+
+
+
+
+
+
+
+
+## Run
+
+Images built for `linux/amd64`, `linux/arm64v8`, and `linux/armv6`
+
+`docker run --rm -it --volume /var/run/docker.sock:/var/run/docker.sock:ro mrjackwills/oxker:latest`
+
+## Help
+
+visit the Github repo
\ No newline at end of file
diff --git a/containerised/Dockerfile b/containerised/Dockerfile
new file mode 100644
index 0000000..d5e77ca
--- /dev/null
+++ b/containerised/Dockerfile
@@ -0,0 +1,58 @@
+#############
+## Builder ##
+#############
+
+FROM --platform=linux/amd64 rust:slim as builder
+
+ARG TARGETARCH
+
+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_ARM_UNKNOWN_LINUX_MUSLEABIHF_LINKER="arm-linux-gnueabihf-ld"
+
+COPY ./containerised/platform.sh .
+
+RUN chmod +x ./platform.sh && ./platform.sh
+
+RUN apt-get update && apt-get install $(cat /.compiler) -y
+
+WORKDIR /usr/src
+
+# Create blank project
+RUN cargo new oxker
+
+# We want dependencies cached, so copy those first
+COPY Cargo.toml Cargo.lock /usr/src/oxker/
+
+# Set the working directory
+WORKDIR /usr/src/oxker
+
+# Install target platform (Cross-Compilation)
+RUN rustup target add $(cat /.platform)
+
+# This is a dummy build to get the dependencies cached
+RUN cargo build --target $(cat /.platform) --release
+
+# Now copy in the rest of the sources
+COPY src /usr/src/oxker/src/
+
+## Touch main.rs to prevent cached release build
+RUN touch /usr/src/oxker/src/main.rs
+
+# This is the actual application build
+RUN cargo build --release --target $(cat /.platform)
+
+RUN cp /usr/src/oxker/target/$(cat /.platform)/release/oxker /
+
+#############
+## Runtime ##
+#############
+
+FROM alpine:latest AS runtime
+
+# Copy application binary from builder image
+COPY --from=builder /oxker /usr/local/bin
+COPY ./containerised/start_oxker.sh ./
+
+# Run the application
+ENTRYPOINT [ "./start_oxker.sh"]
\ No newline at end of file
diff --git a/containerised/create_docker_images.sh b/containerised/create_docker_images.sh
new file mode 100644
index 0000000..9a44e05
--- /dev/null
+++ b/containerised/create_docker_images.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+docker login
+
+docker buildx prune
+
+docker buildx build --platform linux/arm/v6,linux/arm64,linux/amd64 -t mrjackwills/oxker --push -f containerised/Dockerfile .
+
+# Github as well?
+# docker buildx build --platform linux/arm/v6,linux/arm64,linux/amd64 -t ghcr.io/mrjackwills/oxker --push -f containerised/Dockerfile .
\ No newline at end of file
diff --git a/containerised/platform.sh b/containerised/platform.sh
new file mode 100644
index 0000000..43da224
--- /dev/null
+++ b/containerised/platform.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# Used in Docker build to set platform dependent variables
+
+case $TARGETARCH in
+
+ "amd64")
+ echo "x86_64-unknown-linux-musl" > /.platform
+ echo "" > /.compiler
+ ;;
+ "arm64")
+ echo "aarch64-unknown-linux-musl" > /.platform
+ echo "gcc-aarch64-linux-gnu" > /.compiler
+ ;;
+ "arm")
+ echo "arm-unknown-linux-musleabihf" > /.platform
+ echo "gcc-arm-linux-gnueabihf" > /.compiler
+ ;;
+esac
\ No newline at end of file
diff --git a/start_oxker.sh b/containerised/start_oxker.sh
similarity index 100%
rename from start_oxker.sh
rename to containerised/start_oxker.sh
From eff79d3cfbc094f0d79899466085d8c3f1d55691 Mon Sep 17 00:00:00 2001
From: Jack Wills <32690432+mrjackwills@users.noreply.github.com>
Date: Tue, 6 Sep 2022 01:06:56 +0000
Subject: [PATCH 3/7] feat: github action build for DockerHub
---
.../workflows/create_release_and_build.yml | 31 +++++++++++++------
containerised/Dockerfile | 4 +--
2 files changed, 23 insertions(+), 12 deletions(-)
diff --git a/.github/workflows/create_release_and_build.yml b/.github/workflows/create_release_and_build.yml
index 0d629ae..e1bf3ee 100644
--- a/.github/workflows/create_release_and_build.yml
+++ b/.github/workflows/create_release_and_build.yml
@@ -7,16 +7,8 @@ jobs:
deploy:
runs-on: ubuntu-18.04
steps:
- - uses: actions/checkout@master
-
- # cache some rust data?
- - uses: actions/cache@v2
- with:
- path: |
- ~/.cargo/registry
- ~/.cargo/git
- target
- key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
+ - name: Checkout
+ uses: actions/checkout@v3
# Build for linux x86_64
- name: build release linux_x86_64
@@ -72,6 +64,25 @@ jobs:
- name: compress windows_x86_64 binary
run: zip -j ./oxker_windows_x86_64.zip target/x86_64-pc-windows-gnu/release/oxker.exe
+ # Build images for Dockerhub
+ - name: Login to DockerHub
+ uses: docker/login-action@v2
+ with:
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
+
+ - uses: docker/setup-buildx-action@v2
+ id: buildx
+ with:
+ install: true
+ - name: Build for Docker Hub
+ run: |
+ docker build --platform linux/arm/v6,linux/arm64,linux/amd64 \
+ -t ${{ secrets.DOCKERHUB_USERNAME }}/oxker:latest \
+ --push \
+ -f containerised/Dockerfile .
+
+
- name: Release
uses: softprops/action-gh-release@v1
with:
diff --git a/containerised/Dockerfile b/containerised/Dockerfile
index d5e77ca..acff8c2 100644
--- a/containerised/Dockerfile
+++ b/containerised/Dockerfile
@@ -22,7 +22,7 @@ WORKDIR /usr/src
RUN cargo new oxker
# We want dependencies cached, so copy those first
-COPY Cargo.toml Cargo.lock /usr/src/oxker/
+COPY Cargo.* /usr/src/oxker/
# Set the working directory
WORKDIR /usr/src/oxker
@@ -55,4 +55,4 @@ COPY --from=builder /oxker /usr/local/bin
COPY ./containerised/start_oxker.sh ./
# Run the application
-ENTRYPOINT [ "./start_oxker.sh"]
\ No newline at end of file
+ENTRYPOINT [ "./start_oxker.sh"]
From d26f58201d05ca60ac0be6791ab6e4e536c200b9 Mon Sep 17 00:00:00 2001
From: Jack Wills <32690432+mrjackwills@users.noreply.github.com>
Date: Tue, 6 Sep 2022 14:31:27 +0000
Subject: [PATCH 4/7] refactor: update_all_containers filter_map running
---
src/docker_data/mod.rs | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
diff --git a/src/docker_data/mod.rs b/src/docker_data/mod.rs
index c49182c..2675c6c 100644
--- a/src/docker_data/mod.rs
+++ b/src/docker_data/mod.rs
@@ -193,12 +193,13 @@ impl DockerData {
let current_sort = self.app_data.lock().get_sorted();
self.app_data.lock().set_sorted(current_sort);
+ // Just get the containers that are currently running, no point updating info on paused or dead containers
output
.iter()
.filter_map(|i| {
i.id.as_ref().map(|id| {
(
- i.state.as_ref().unwrap_or(&String::new()) == "running",
+ i.state == Some("running".to_owned()),
id.clone(),
)
})
@@ -331,53 +332,53 @@ impl DockerData {
match message {
DockerMessage::Pause(id) => {
let loading_spin = self.loading_spin().await;
- docker.pause_container(&id).await.unwrap_or_else(|_| {
+ if docker.pause_container(&id).await.is_err() {
app_data
.lock()
.set_error(AppError::DockerCommand(DockerControls::Pause));
- });
+ };
self.stop_loading_spin(&loading_spin);
}
DockerMessage::Restart(id) => {
let loading_spin = self.loading_spin().await;
- docker
+ if docker
.restart_container(&id, None)
.await
- .unwrap_or_else(|_| {
+ .is_err() {
app_data
.lock()
.set_error(AppError::DockerCommand(DockerControls::Restart));
- });
+ };
self.stop_loading_spin(&loading_spin);
}
DockerMessage::Start(id) => {
let loading_spin = self.loading_spin().await;
- docker
+ if docker
.start_container(&id, None::>)
.await
- .unwrap_or_else(|_| {
+ .is_err() {
app_data
.lock()
.set_error(AppError::DockerCommand(DockerControls::Start));
- });
+ };
self.stop_loading_spin(&loading_spin);
}
DockerMessage::Stop(id) => {
let loading_spin = self.loading_spin().await;
- docker.stop_container(&id, None).await.unwrap_or_else(|_| {
+ if docker.stop_container(&id, None).await.is_err() {
app_data
.lock()
.set_error(AppError::DockerCommand(DockerControls::Stop));
- });
+ };
self.stop_loading_spin(&loading_spin);
}
DockerMessage::Unpause(id) => {
let loading_spin = self.loading_spin().await;
- docker.unpause_container(&id).await.unwrap_or_else(|_| {
+ if docker.unpause_container(&id).await.is_err() {
app_data
.lock()
.set_error(AppError::DockerCommand(DockerControls::Unpause));
- });
+ };
self.stop_loading_spin(&loading_spin);
self.update_everything().await;
}
From d6e2026eecfbbf307058bee29f62ad95207d22c3 Mon Sep 17 00:00:00 2001
From: Jack Wills <32690432+mrjackwills@users.noreply.github.com>
Date: Tue, 6 Sep 2022 14:31:55 +0000
Subject: [PATCH 5/7] refactor: AppError display impl
---
src/app_error.rs | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/app_error.rs b/src/app_error.rs
index 1f2d889..767b204 100644
--- a/src/app_error.rs
+++ b/src/app_error.rs
@@ -16,17 +16,17 @@ pub enum AppError {
/// Convert errors into strings to display
impl fmt::Display for AppError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- let disp = match self {
- Self::DockerConnect => "Unable to access docker daemon".to_owned(),
- Self::DockerInterval => "Docker update interval needs to be greater than 0".to_owned(),
- Self::InputPoll => "Unable to poll user input".to_owned(),
- Self::Terminal => "Unable to draw to terminal".to_owned(),
- Self::DockerCommand(s) => format!("Unable to {} container", s),
+ match self {
+ Self::DockerConnect => write!(f, "Unable to access docker daemon"),
+ Self::DockerInterval => write!(f, "Docker update interval needs to be greater than 0"),
+ Self::InputPoll => write!(f, "Unable to poll user input"),
+ Self::Terminal => write!(f, "Unable to draw to terminal"),
+ Self::DockerCommand(s) => write!(f, "Unable to {} container", s),
Self::MouseCapture(x) => {
let reason = if *x { "en" } else { "dis" };
- format!("Unable to {}able mouse capture", reason)
+ write!(f, "Unbale to {}able mouse capture", reason)
}
- };
- write!(f, "{}", disp)
+ }
+
}
}
From 211f481c3846cca5db728eac8b2ee11448b8bfd7 Mon Sep 17 00:00:00 2001
From: Jack Wills <32690432+mrjackwills@users.noreply.github.com>
Date: Tue, 6 Sep 2022 14:38:29 +0000
Subject: [PATCH 6/7] feat: self dockerisation dev Dockefile
---
.github/workflows/create_release_and_build.yml | 1 -
containerised/Dockerfile | 1 +
containerised/Dockerfile_dev | 15 +++++++++++++++
containerised/platform.sh | 1 -
4 files changed, 16 insertions(+), 2 deletions(-)
create mode 100644 containerised/Dockerfile_dev
diff --git a/.github/workflows/create_release_and_build.yml b/.github/workflows/create_release_and_build.yml
index e1bf3ee..2a4b26f 100644
--- a/.github/workflows/create_release_and_build.yml
+++ b/.github/workflows/create_release_and_build.yml
@@ -82,7 +82,6 @@ jobs:
--push \
-f containerised/Dockerfile .
-
- name: Release
uses: softprops/action-gh-release@v1
with:
diff --git a/containerised/Dockerfile b/containerised/Dockerfile
index acff8c2..18e9953 100644
--- a/containerised/Dockerfile
+++ b/containerised/Dockerfile
@@ -6,6 +6,7 @@ FROM --platform=linux/amd64 rust:slim as builder
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_RUSTFLAGS="-C target-feature=+crt-static -C link-arg=-lgcc"
ENV CARGO_TARGET_ARM_UNKNOWN_LINUX_MUSLEABIHF_LINKER="arm-linux-gnueabihf-ld"
diff --git a/containerised/Dockerfile_dev b/containerised/Dockerfile_dev
new file mode 100644
index 0000000..ea142ab
--- /dev/null
+++ b/containerised/Dockerfile_dev
@@ -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
\ No newline at end of file
diff --git a/containerised/platform.sh b/containerised/platform.sh
index 43da224..393769a 100644
--- a/containerised/platform.sh
+++ b/containerised/platform.sh
@@ -1,5 +1,4 @@
#!/bin/sh
-
# Used in Docker build to set platform dependent variables
case $TARGETARCH in
From 3d760d23cd218bf1bb7db5a53f77879b5bc727f2 Mon Sep 17 00:00:00 2001
From: Jack Wills <32690432+mrjackwills@users.noreply.github.com>
Date: Tue, 6 Sep 2022 14:40:00 +0000
Subject: [PATCH 7/7] docs: comments
---
CHANGELOG.md | 2 +-
containerised/create_docker_images.sh | 10 ----------
src/main.rs | 1 +
src/ui/mod.rs | 2 +-
4 files changed, 3 insertions(+), 12 deletions(-)
delete mode 100644 containerised/create_docker_images.sh
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b504e4c..f9230af 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,11 +2,11 @@
+ dependencies updated, [a3168daa3f769a6747dfbe61103073a7e80a1485], [78e59160bb6a978ee80e3a99eb72f051fb64e737]
### Fixes
-+ limit image name to 64 chars max, [b8f7763dd5ac7d0361dd7bfc1dad40f50ee95ae1]
+ devcontainer updated, [3bde4f5629539cab3dbb57556663ab81685f9d7a]
### Features
+ derive Eq where appropriate, [d7c2601f959bc12a64cd25cef59c837e1e8c2b2a]
++ containerize self, github action to build and push to Docker Hub, []
+ ignore containers 'oxker' containers, [1be9f52ad4a68f93142784e9df630c59cdec0a79]
### Refactors
diff --git a/containerised/create_docker_images.sh b/containerised/create_docker_images.sh
deleted file mode 100644
index 9a44e05..0000000
--- a/containerised/create_docker_images.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-
-docker login
-
-docker buildx prune
-
-docker buildx build --platform linux/arm/v6,linux/arm64,linux/amd64 -t mrjackwills/oxker --push -f containerised/Dockerfile .
-
-# Github as well?
-# docker buildx build --platform linux/arm/v6,linux/arm64,linux/amd64 -t ghcr.io/mrjackwills/oxker --push -f containerised/Dockerfile .
\ No newline at end of file
diff --git a/src/main.rs b/src/main.rs
index 8015736..37b6919 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -100,6 +100,7 @@ async fn main() {
.unwrap_or(());
} else {
loop {
+ // TODO this needs to be improved to display something useful
info!("in debug mode");
tokio::time::sleep(std::time::Duration::from_millis(5000)).await;
}
diff --git a/src/ui/mod.rs b/src/ui/mod.rs
index 9a529fd..ba02a91 100644
--- a/src/ui/mod.rs
+++ b/src/ui/mod.rs
@@ -109,7 +109,7 @@ async fn run_app(
if terminal.draw(|f| ui(f, &app_data, &gui_state)).is_err() {
return Err(AppError::Terminal);
}
- if crossterm::event::poll(input_poll_rate).unwrap_or_default() {
+ if crossterm::event::poll(input_poll_rate).unwrap_or(false) {
if let Ok(event) = event::read() {
if let Event::Key(key) = event {
sender