Docker
Docker Images
Manage Docker images with SkyPort
Docker Image Management
Manage Docker images - building, pulling, pushing, and maintaining images.
Listing Images
# List local images
skyport docker images
# List with size information
skyport docker images --format table
# Search Docker Hub
skyport docker search nginx
Pulling Images
From Docker Hub
# Pull latest version
skyport docker pull nginx:latest
# Pull specific version
skyport docker pull postgres:15
# Pull from specific registry
skyport docker pull registry.example.com/app:1.0.0
Building Images
From Dockerfile
# Build in current directory
skyport docker build -t my-app:1.0.0 .
# Build from specific file
skyport docker build -f Dockerfile.prod -t my-app:prod .
# Build with build arguments
skyport docker build \
-t my-app:1.0.0 \
--build-arg VERSION=1.0.0 \
--build-arg NODE_ENV=production \
.
# Build with labels
skyport docker build \
-t my-app:1.0.0 \
--label version=1.0.0 \
--label maintainer=team@example.com \
.
Pushing Images
# Tag image for registry
skyport docker tag my-app:1.0.0 registry.example.com/my-app:1.0.0
# Push to Docker Hub
skyport docker push my-app:1.0.0
# Push to private registry
skyport docker push registry.example.com/my-app:1.0.0
Image Inspection
# View image details
skyport docker inspect image-name
# View image history
skyport docker history image-name
# View image layers
skyport docker image inspect image-name
Image Management
# Remove image
skyport docker rmi image-name:tag
# Remove unused images
skyport docker image prune
# Remove all images
skyport docker rmi -a
# Remove dangling images
skyport docker image prune --filter "dangling=true"
Best Practices
- Use specific version tags (not
latest) - Minimize image layers
- Use multi-stage builds
- Keep images small
- Scan images for vulnerabilities
Next: Docker Volumes | Docker Networks
