`Failed to open archive (Unrecognized archive format)` in Docker container

I have the following Docker container that I’m using to run a nix-update script in Gitea Actions.

actionsImage = pkgs.dockerTools.streamLayeredImage {
  name = "actions-image";
  tag = "latest";
  contents = with pkgs; [
    bash
    cacert
    coreutils
    git
    gnugrep
    gnutar
    gzip
    jq
    less
    nix
    nix-update
    nodejs
    openssl
    # Provides the env utility at /usr/bin/env.
    dockerTools.usrBinEnv
  ];
  config = {
    Cmd = [ "bash" ];
    Env = [
      "SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt"
      "NIX_CONFIG=extra-experimental-features = nix-command flakes"
    ];
  };
};

When ever the script runs in the action, it gives me this error:

Prefixing "jq" with "nixpkgs#"
Prefixing "nix-update" with "nixpkgs#"
[command]/bin/nix profile install --profile /tmp/nix-profile-BbnJIO/.nix-profile --inputs-from file:///nix/store/yhc8a0a2mvbp8fp53l57i3d5cnz735fc-source?narHash=sha256-FshoQvr6Aor5SnORVvh%2FZdJ1Sa2U4ZrIMwKBX5k2wu0%3D nixpkgs#nix-update nixpkgs#jq
warning: the group 'nixbld' specified in 'build-users-group' does not exist
unpacking 'file:///nix/store/yhc8a0a2mvbp8fp53l57i3d5cnz735fc-source' into the Git cache...
error:
       … while fetching the input 'file:///nix/store/yhc8a0a2mvbp8fp53l57i3d5cnz735fc-source?narHash=sha256-FshoQvr6Aor5SnORVvh/ZdJ1Sa2U4ZrIMwKBX5k2wu0%3D'
       error: Failed to open archive (Unrecognized archive format)
::error::Workflow run failed: The process '/bin/nix' failed with exit code 1

How can I fix this? I don’t even know what archive it’s talking about because the environment is wiped when the action fails.