def METHOD_NAME(self, other: "DockerContainerContext"):
    # Combines config set at a higher level with overrides/additions that are set at a lower
    # level. For example, a certain set of config set in the `DockerRunLauncher`` can be
    # combined with config set at the step level in the `docker_executor`.
    # Lists of env vars and secrets are appended, the registry is replaced, and the
    # `container_kwargs` field does a shallow merge so that different kwargs can be combined
    # or replaced without replacing the full set of arguments.
    return DockerContainerContext(
        registry=other.registry if other.registry is not None else self.registry,
        env_vars=[*self.env_vars, *other.env_vars],
        networks=[*self.networks, *other.networks],
        container_kwargs={**self.container_kwargs, **other.container_kwargs},
    )