dockerTools.buildLayeredImage: fix typo in comments

This commit is contained in:
Antoine Eiche 2020-01-11 09:02:30 +01:00
parent 0d983f9f99
commit da261e3631
2 changed files with 9 additions and 9 deletions

View File

@ -625,11 +625,11 @@ rec {
echo "Cooking the image..." echo "Cooking the image..."
# tar exits with an exit code of 1 if files changed while it was # tar exits with an exit code of 1 if files changed while it was
# reading them. it considers a change in the number of hard links # reading them. It considers a change in the number of hard links
# to be a "change", which can cause this to fail if images are being # to be a "change", which can cause this to fail if images are being
# built concurrently and auto-optimise-store is turned on. since # built concurrently and the auto-optimise-store nix option is turned on.
# know the contents of these files will not change, we can reasonably # Since the contents of these files will not change, we can reasonably
# ignore this exit code # ignore this exit code.
set +e set +e
tar -C image --dereference --hard-dereference --sort=name \ tar -C image --dereference --hard-dereference --sort=name \
--mtime="@$SOURCE_DATE_EPOCH" --owner=0 --group=0 \ --mtime="@$SOURCE_DATE_EPOCH" --owner=0 --group=0 \

View File

@ -13,8 +13,8 @@ echo "Creating layer #$layerNumber for $storePath"
mkdir -p "$layerPath" mkdir -p "$layerPath"
# make sure /nix and /nix/store appear first in the archive. # Make sure /nix and /nix/store appear first in the archive.
# we create the directories here and use them because # We create the directories here and use them because
# when there are other things being added to the # when there are other things being added to the
# nix store, tar could fail, saying, # nix store, tar could fail, saying,
# "tar: /nix/store: file changed as we read it" # "tar: /nix/store: file changed as we read it"
@ -25,16 +25,16 @@ tar -cf "$layerPath/layer.tar" \
--transform='s,nix,/nix,' \ --transform='s,nix,/nix,' \
nix nix
# we change into the /nix/store in order to avoid a similar # We change into the /nix/store in order to avoid a similar
# "file changed as we read it" error as above. Namely, # "file changed as we read it" error as above. Namely,
# if we use the absolute path of /nix/store/123-pkg # if we use the absolute path of /nix/store/123-pkg
# and something new it added to the nix store while tar # and something new is added to the nix store while tar
# is running, it will detect a change to /nix/store and # is running, it will detect a change to /nix/store and
# fail. Instead, if we cd into the nix store and copy # fail. Instead, if we cd into the nix store and copy
# the relative nix store path, tar will ignore changes # the relative nix store path, tar will ignore changes
# to /nix/store. In order to create the correct structure # to /nix/store. In order to create the correct structure
# in the tar file, we transform the relative nix store # in the tar file, we transform the relative nix store
# path to the absolute store path # path to the absolute store path.
n=$(basename "$storePath") n=$(basename "$storePath")
tar -C /nix/store -rpf "$layerPath/layer.tar" \ tar -C /nix/store -rpf "$layerPath/layer.tar" \
--hard-dereference --sort=name \ --hard-dereference --sort=name \