summary refs log tree commit diff
path: root/pkgs/build-support/docker
diff options
context:
space:
mode:
authorSamuel Dionne-Riel <samuel@dionne-riel.com>2018-05-22 20:25:04 -0400
committerSamuel Dionne-Riel <samuel@dionne-riel.com>2018-05-24 12:23:51 -0400
commit902b0593be857e4f19b9875638af6e854aa99a9b (patch)
tree8e2a7562ba31975799905e432a1920eb9594c955 /pkgs/build-support/docker
parent60737bd31985116b7cce47f221e8568e66ab73e0 (diff)
downloadnixpkgs-902b0593be857e4f19b9875638af6e854aa99a9b.tar
nixpkgs-902b0593be857e4f19b9875638af6e854aa99a9b.tar.gz
nixpkgs-902b0593be857e4f19b9875638af6e854aa99a9b.tar.bz2
nixpkgs-902b0593be857e4f19b9875638af6e854aa99a9b.tar.lz
nixpkgs-902b0593be857e4f19b9875638af6e854aa99a9b.tar.xz
nixpkgs-902b0593be857e4f19b9875638af6e854aa99a9b.tar.zst
nixpkgs-902b0593be857e4f19b9875638af6e854aa99a9b.zip
tests/docker-tools: Adds regression test for #34779
Diffstat (limited to 'pkgs/build-support/docker')
-rw-r--r--pkgs/build-support/docker/examples.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/pkgs/build-support/docker/examples.nix b/pkgs/build-support/docker/examples.nix
index eb5b9fe36e4..ca7f7809379 100644
--- a/pkgs/build-support/docker/examples.nix
+++ b/pkgs/build-support/docker/examples.nix
@@ -124,4 +124,16 @@ rec {
     fromImage = nixFromDockerHub;
     contents = [ pkgs.hello ];
   };
+
+  # 8. regression test for erroneous use of eval and string expansion.
+  # See issue #34779 and PR #40947 for details.
+  runAsRootExtraCommands = pkgs.dockerTools.buildImage {
+    name = "runAsRootExtraCommands";
+    contents = [ pkgs.coreutils ];
+    # The parens here are to create problematic bash to embed and eval. In case
+    # this is *embedded* into the script (with nix expansion) the initial quotes
+    # will close the string and the following parens are unexpected
+    runAsRoot = ''echo "(runAsRoot)" > runAsRoot'';
+    extraCommands = ''echo "(extraCommand)" > extraCommands'';
+  };
 }