From afbca4843dcfed2f2a39f3e3837fe53aad9ca139 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Mon, 18 Aug 2025 20:29:47 +0100 Subject: [PATCH 1/6] Automated commit Signed-off-by: Oliver Davies --- Containerfile | 3 +++ index.php | 3 +++ notes.adoc | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 Containerfile create mode 100644 index.php create mode 100644 notes.adoc diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..a2aef35 --- /dev/null +++ b/Containerfile @@ -0,0 +1,3 @@ +FROM php + +CMD php -v diff --git a/index.php b/index.php new file mode 100644 index 0000000..e6744ba --- /dev/null +++ b/index.php @@ -0,0 +1,3 @@ + d1ec5296cbf0 +d1ec5296cbf0da21054b4261a0bb72f66449fe8e8f51b071e53df64e6f83eff4 + +podman run --rm d1ec5296cbf0 +PHP 8.4.11 (cli) (built: Aug 12 2025 22:28:40) (NTS) +Copyright (c) The PHP Group +Built by https://github.com/docker-library/php +Zend Engine v4.4.11, Copyright (c) Zend Technologies + with Zend OPcache v8.4.11, Copyright (c), by Zend Technologies From d35c2ec3c8526f542f4157aec60ff49a5d9aa30a Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Mon, 18 Aug 2025 20:35:00 +0100 Subject: [PATCH 2/6] Automated commit Signed-off-by: Oliver Davies --- Containerfile | 6 +++++- notes.adoc | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/Containerfile b/Containerfile index a2aef35..4a13f85 100644 --- a/Containerfile +++ b/Containerfile @@ -1,3 +1,7 @@ FROM php -CMD php -v +COPY index.php /app/index.php + +WORKDIR /app + +CMD php index.php diff --git a/notes.adoc b/notes.adoc index cb9832f..ec04b1f 100644 --- a/notes.adoc +++ b/notes.adoc @@ -50,3 +50,21 @@ Copyright (c) The PHP Group Built by https://github.com/docker-library/php Zend Engine v4.4.11, Copyright (c) Zend Technologies with Zend OPcache v8.4.11, Copyright (c), by Zend Technologies + +=== Building a container with code inside + +podman build . + +STEP 1/4: FROM php +STEP 2/4: COPY index.php /app/index.php +--> b592e9b3b69f +STEP 3/4: WORKDIR /app +--> 8f591440552a +STEP 4/4: CMD php index.php +COMMIT +--> ec4c5890c8a7 +ec4c5890c8a75e93e1bb768f998e49ae7d2bf005e5e7c2a57dd2813b881e9758 + +podman run --rm ec4c5890c8a7 + +Hi, PHP Thames Valley! From 375df89de9b8a81727f12b2ff8994efe02e15b6d Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Mon, 18 Aug 2025 20:46:40 +0100 Subject: [PATCH 3/6] Automated commit Signed-off-by: Oliver Davies --- notes.adoc | 14 ++++++++++++++ shell.nix | 7 +++++++ 2 files changed, 21 insertions(+) create mode 100644 shell.nix diff --git a/notes.adoc b/notes.adoc index ec04b1f..80af76d 100644 --- a/notes.adoc +++ b/notes.adoc @@ -68,3 +68,17 @@ ec4c5890c8a75e93e1bb768f998e49ae7d2bf005e5e7c2a57dd2813b881e9758 podman run --rm ec4c5890c8a7 Hi, PHP Thames Valley! + +=== Using shell.nix + +nix-shell + +[nix-shell:~/php-thames-valley]$ php index.php + +Hi, PHP Thames Valley + +==== Running a command without entering a shell + +nix-shell --run "php index.php" + +Hi, PHP Thames Valley! diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..d6d8241 --- /dev/null +++ b/shell.nix @@ -0,0 +1,7 @@ +{ + pkgs ? import { }, +}: + +pkgs.mkShell { + packages = [ pkgs.php ]; +} From 0418d315eb773eb18fbaf760b186ed378d7a744e Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Mon, 18 Aug 2025 21:00:33 +0100 Subject: [PATCH 4/6] Automated commit Signed-off-by: Oliver Davies --- notes.adoc | 11 +++++++++++ shell.nix | 6 +++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/notes.adoc b/notes.adoc index 80af76d..4fb37a6 100644 --- a/notes.adoc +++ b/notes.adoc @@ -82,3 +82,14 @@ Hi, PHP Thames Valley nix-shell --run "php index.php" Hi, PHP Thames Valley! + +== Adding PHP tools + +nix-shell --run "composer --version" + +Composer version 2.8.5 2025-01-21 15:23:40 +PHP version 8.4.11 (/nix/store/s4kv9bzqawhqcyjg9xm2hji3jap6d6kd-php-with-extensions-8.4.11/bin/php) + +nix-shell --run "phpactor --version" + +Phpactor 2025.07.25.0 diff --git a/shell.nix b/shell.nix index d6d8241..2238b00 100644 --- a/shell.nix +++ b/shell.nix @@ -3,5 +3,9 @@ }: pkgs.mkShell { - packages = [ pkgs.php ]; + packages = with pkgs; [ + php + phpPackages.composer + phpactor + ]; } From 1d166f3660bb2c7d74e701c8e7b78f4a1a98e72b Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Mon, 18 Aug 2025 21:14:03 +0100 Subject: [PATCH 5/6] Automated commit Signed-off-by: Oliver Davies --- flake.lock | 27 +++++++++++++++++++++++++++ flake.nix | 15 +++++++++++++++ notes.adoc | 10 ++++++++++ 3 files changed, 52 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..ab5f113 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1755186698, + "narHash": "sha256-wNO3+Ks2jZJ4nTHMuks+cxAiVBGNuEBXsT29Bz6HASo=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "fbcf476f790d8a217c3eab4e12033dc4a0f6d23c", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..a319105 --- /dev/null +++ b/flake.nix @@ -0,0 +1,15 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + }; + + outputs = + inputs: + let + system = "x86_64-linux"; + pkgs = import inputs.nixpkgs { inherit system; }; + in + { + devShells.${system}.default = (import ./shell.nix { inherit pkgs; }); + }; +} diff --git a/notes.adoc b/notes.adoc index 4fb37a6..eb401a7 100644 --- a/notes.adoc +++ b/notes.adoc @@ -93,3 +93,13 @@ PHP version 8.4.11 (/nix/store/s4kv9bzqawhqcyjg9xm2hji3jap6d6kd-php-with-extensi nix-shell --run "phpactor --version" Phpactor 2025.07.25.0 + +--- + +inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; +}; + +is the same as + +inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; From 1a64bf2db6f4d61adac901f55fd0c2a9bc88e0de Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Mon, 18 Aug 2025 21:14:58 +0100 Subject: [PATCH 6/6] Automated commit Signed-off-by: Oliver Davies --- flake.nix | 8 +++++++- shell.nix | 11 ----------- 2 files changed, 7 insertions(+), 12 deletions(-) delete mode 100644 shell.nix diff --git a/flake.nix b/flake.nix index a319105..f8fcf16 100644 --- a/flake.nix +++ b/flake.nix @@ -10,6 +10,12 @@ pkgs = import inputs.nixpkgs { inherit system; }; in { - devShells.${system}.default = (import ./shell.nix { inherit pkgs; }); + devShells.${system}.default = pkgs.mkShell { + packages = with pkgs; [ + php + phpPackages.composer + phpactor + ]; + }; }; } diff --git a/shell.nix b/shell.nix deleted file mode 100644 index 2238b00..0000000 --- a/shell.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ - pkgs ? import { }, -}: - -pkgs.mkShell { - packages = with pkgs; [ - php - phpPackages.composer - phpactor - ]; -}