Bird
0
0

In a GitHub Actions workflow, you want to build a multi-architecture Docker image (amd64 and arm64) and push it. Which action or command helps achieve this?

hard📝 Application Q9 of 15
Docker - in CI/CD
In a GitHub Actions workflow, you want to build a multi-architecture Docker image (amd64 and arm64) and push it. Which action or command helps achieve this?
AUse 'docker run' with --arch flag
BUse 'docker buildx build' with --platform flag
CUse 'docker-compose up' with multi-arch option
DUse 'docker build' twice with different tags
Step-by-Step Solution
Solution:
  1. Step 1: Understand multi-arch build

    'docker buildx' supports building images for multiple platforms in one command.
  2. Step 2: Identify correct usage

    Using 'docker buildx build --platform linux/amd64,linux/arm64' builds multi-arch images.
  3. Final Answer:

    Use 'docker buildx build' with --platform flag -> Option B
  4. Quick Check:

    Multi-arch build = docker buildx build [OK]
Quick Trick: Use buildx and --platform for multi-arch images [OK]
Common Mistakes:
  • Building twice with docker build does not create multi-arch image
  • docker-compose does not build multi-arch images
  • docker run does not build images

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes