0
0
Dockerdevops~10 mins

GitHub Actions with Docker - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the Docker image to use in the GitHub Actions workflow.

Docker
jobs:
  build:
    runs-on: ubuntu-latest
    container:
      image: [1]
Drag options to blanks, or click blank then click option'
Aactions/checkout@v3
Bnode:14
Cubuntu-latest
Ddocker/build-push-action@v3
Attempts:
3 left
💡 Hint
Common Mistakes
Using a GitHub Action name instead of a Docker image.
Using a runner label like 'ubuntu-latest' as image.
2fill in blank
medium

Complete the code to check out the repository in a GitHub Actions workflow step.

Docker
- name: Checkout code
  uses: [1]
Drag options to blanks, or click blank then click option'
Aactions/checkout@v3
Bdocker/build-push-action@v3
Cactions/setup-node@v3
Dactions/upload-artifact@v3
Attempts:
3 left
💡 Hint
Common Mistakes
Using a build or setup action instead of checkout.
Using an upload artifact action here.
3fill in blank
hard

Fix the error in the step to build and push a Docker image using the official GitHub Action.

Docker
- name: Build and push Docker image
  uses: docker/build-push-action@v3
  with:
    context: .
    push: [1]
Drag options to blanks, or click blank then click option'
Afalsee
B1
Cyes
Dtrue
Attempts:
3 left
💡 Hint
Common Mistakes
Using misspelled boolean values like 'falsee'.
Using strings like 'yes' or numbers like '1'.
4fill in blank
hard

Fill both blanks to set environment variables for Docker Hub username and password in the workflow step.

Docker
- name: Log in to Docker Hub
  uses: docker/login-action@v2
  with:
    username: ${{ secrets.[1] }}
    password: ${{ secrets.[2] }}
Drag options to blanks, or click blank then click option'
ADOCKER_USERNAME
BGITHUB_TOKEN
CDOCKER_PASSWORD
DAWS_SECRET
Attempts:
3 left
💡 Hint
Common Mistakes
Using unrelated secrets like 'GITHUB_TOKEN' or 'AWS_SECRET'.
Mixing up username and password secret names.
5fill in blank
hard

Fill all three blanks to build a Docker image with a tag and push it using the GitHub Actions Docker build-push action.

Docker
- name: Build and push Docker image
  uses: docker/build-push-action@v3
  with:
    context: [1]
    push: [2]
    tags: [3]
Drag options to blanks, or click blank then click option'
A.
Btrue
Cmyuser/myapp:latest
Dfalse
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'false' for push when you want to push.
Using wrong context path.
Missing or incorrect image tag.