Yes, for many AI batch jobs. The honest version is that Docker gives you a portable package, not a guarantee that every cloud target has the same GPU, driver, architecture, storage, quota, or credentials. Build for the right platform, keep cloud-specific behavior outside the image, and smoke-test the image on every target class you care about.
What must be portable
- The image targets the cloud VM architecture, usually
linux/amd64for anycloud GPU VM targets. - CUDA, PyTorch, TensorFlow, or other GPU libraries are compatible with the host NVIDIA driver.
- The startup command does not depend on one cloud provider's metadata service.
- Data paths are passed in at runtime, such as
/mnt/inputand/mnt/output, instead of hard-coded provider paths. - Secrets and credentials come from environment variables, mounted files, or platform identity rather than being baked into the image.
What usually breaks portability
- Architecture mismatch: an image built only for ARM64 may fail on x86 GPU VMs.
- Driver/runtime mismatch: a newer CUDA runtime may need a newer host driver than the VM image provides.
- Cloud-specific storage: hard-coded S3, GCS, Azure Blob, or local disk assumptions can make the same image behave differently.
- Private registry auth: the image may be portable, but the VM still needs permission to pull it.
A practical smoke test
- Build and push the image by digest, not only by a moving tag.
- Run
nvidia-smior a tiny CUDA/PyTorch check at startup. - Read a small file from input storage and write a small output file.
- Run the same command on the GPU families and providers you plan to use before launching a long job.
- Keep provider-specific tuning in configuration, not in separate image builds, unless the dependency really differs by provider.
Where anycloud fits
anycloud is designed around this model: submit a Docker image, GPU target, command, and optional buckets, then let anycloud provision a VM, pull the image, mount configured folders, run the container, and clean up.
The image still has to be a good Linux GPU image. anycloud can move the job across clouds, but it cannot make an ARM-only image run on an x86 target, fix a CUDA/driver mismatch inside the container, or infer provider-specific credentials that were baked into the app.