From a24c5bd1a5b0a4b4ca57e7c9d2e189c8b5284a5c Mon Sep 17 00:00:00 2001 From: xZero707 Date: Mon, 20 May 2024 21:58:24 +0200 Subject: [PATCH] Rename to bin/dev-shell to avoid confusion --- .gitignore | 1 + Dockerfile.dev | 19 +++++++++++++++++++ bin/dev-shell | 24 ++++++++++++++++++++++++ bin/shell | 16 ---------------- 4 files changed, 44 insertions(+), 16 deletions(-) create mode 100644 Dockerfile.dev create mode 100755 bin/dev-shell delete mode 100755 bin/shell diff --git a/.gitignore b/.gitignore index 6bbdf9d..991f3c2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .idea/ wordpress.iml +data/ build/patch-util/wp-src/ build/tests-util/composer.lock build/tests-util/vendor/ diff --git a/Dockerfile.dev b/Dockerfile.dev new file mode 100644 index 0000000..4ef46f5 --- /dev/null +++ b/Dockerfile.dev @@ -0,0 +1,19 @@ +ARG WP_VERSION=6.5.3 +FROM scratch AS rootfs + +# Install composer +COPY --from=composer:2.7 ["/usr/bin/composer", "/usr/local/bin/composer"] + + + +ARG WP_VERSION +FROM ghcr.io/n0rthernl1ghts/wordpress:${WP_VERSION} + +RUN set -eux \ + && apk add --update --no-cache exa file fish git less nano openssh-client rsync tree unzip wget + +COPY --from=rootfs ["/", "/"] + + +WORKDIR "/workspace" +ENTRYPOINT ["/usr/bin/fish"] diff --git a/bin/dev-shell b/bin/dev-shell new file mode 100755 index 0000000..ba296fa --- /dev/null +++ b/bin/dev-shell @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + + + +# This is development util +main() { + local wpVersion="${1:-6.5.3}" + + set -ex + + docker build \ + --file=Dockerfile.dev \ + --build-arg="WP_VERSION=${wpVersion}" \ + -t "localhost/nlss-wp-dev:${wpVersion}" . + + docker run \ + --init \ + --rm \ + -it \ + -v "${PWD}/src/:/workspace" \ + "localhost/nlss-wp-dev:${wpVersion}" +} + +main "${@}" diff --git a/bin/shell b/bin/shell deleted file mode 100755 index 0002ab8..0000000 --- a/bin/shell +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash - -# This is development util -main() { - local wpVersion="${1:-latest}" - docker run \ - --init \ - --entrypoint="/bin/bash" \ - --workdir="/app" \ - --rm \ - -it \ - -v "${PWD}/src/init-utils:/app" \ - "ghcr.io/n0rthernl1ghts/wordpress:${wpVersion}" -} - -main "${@}"