Merge pull request #43119 from nlewo/pr-fix-docker-tools-tests

dockerTools.examples: explicitly set image tag to fix docker-tools tests
This commit is contained in:
lewo 2018-07-06 17:52:29 +02:00 committed by GitHub
commit 2b5d151471
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,6 +13,7 @@ rec {
# 1. basic example # 1. basic example
bash = buildImage { bash = buildImage {
name = "bash"; name = "bash";
tag = "latest";
contents = pkgs.bashInteractive; contents = pkgs.bashInteractive;
}; };
@ -65,6 +66,7 @@ rec {
in in
buildImage { buildImage {
name = "nginx-container"; name = "nginx-container";
tag = "latest";
contents = pkgs.nginx; contents = pkgs.nginx;
runAsRoot = '' runAsRoot = ''
@ -106,6 +108,7 @@ rec {
# docker run -it --rm nix nix-store -qR $(nix-build '<nixpkgs>' -A nix) # docker run -it --rm nix nix-store -qR $(nix-build '<nixpkgs>' -A nix)
nix = buildImageWithNixDb { nix = buildImageWithNixDb {
name = "nix"; name = "nix";
tag = "latest";
contents = [ contents = [
# nix-store uses cat program to display results as specified by # nix-store uses cat program to display results as specified by
# the image env variable NIX_PAGER. # the image env variable NIX_PAGER.
@ -121,6 +124,7 @@ rec {
# dockerTools chain. # dockerTools chain.
onTopOfPulledImage = buildImage { onTopOfPulledImage = buildImage {
name = "onTopOfPulledImage"; name = "onTopOfPulledImage";
tag = "latest";
fromImage = nixFromDockerHub; fromImage = nixFromDockerHub;
contents = [ pkgs.hello ]; contents = [ pkgs.hello ];
}; };
@ -129,6 +133,7 @@ rec {
# See issue #34779 and PR #40947 for details. # See issue #34779 and PR #40947 for details.
runAsRootExtraCommands = pkgs.dockerTools.buildImage { runAsRootExtraCommands = pkgs.dockerTools.buildImage {
name = "runAsRootExtraCommands"; name = "runAsRootExtraCommands";
tag = "latest";
contents = [ pkgs.coreutils ]; contents = [ pkgs.coreutils ];
# The parens here are to create problematic bash to embed and eval. In case # 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 # this is *embedded* into the script (with nix expansion) the initial quotes