remove
Some checks failed
Fetch and Run Hello World Docker Image / fetch-hello-world (push) Failing after 1s
Some checks failed
Fetch and Run Hello World Docker Image / fetch-hello-world (push) Failing after 1s
This commit is contained in:
parent
6a7ad2537c
commit
1b13e03af6
@ -1,32 +1,23 @@
|
|||||||
version: "1"
|
name: "Fetch and Run Hello World Docker Image"
|
||||||
name: "Fetch and Run Alpine Docker Image"
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push: # This will trigger the job on each push (can be modified to suit)
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main # Change to 'master' if that is your default branch
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
fetch-alpine:
|
fetch-hello-world:
|
||||||
runs-on: ubuntu-latest # The runner environment
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: "Set up Docker"
|
- name: "Set up Docker"
|
||||||
run: |
|
run: |
|
||||||
# Ensure Docker is installed (may not be needed if pre-installed)
|
|
||||||
docker --version || sudo apt-get update && sudo apt-get install -y docker.io
|
docker --version || sudo apt-get update && sudo apt-get install -y docker.io
|
||||||
|
|
||||||
- name: "Fetch and Run Alpine"
|
- name: "Pull and Run Hello World"
|
||||||
run: |
|
run: |
|
||||||
for i in {1..6}; do
|
echo "Pulling and running Hello World Docker image..."
|
||||||
echo "Iteration $i: Pulling and running Alpine..."
|
docker pull hello-world
|
||||||
|
|
||||||
# Pull the Alpine image
|
# Run the Hello World image
|
||||||
docker pull alpine:latest
|
docker run --rm hello-world
|
||||||
|
|
||||||
# Run the Alpine image (this will just run the default command, which is 'sh')
|
|
||||||
docker run --rm alpine:latest echo "Hello from Alpine!"
|
|
||||||
|
|
||||||
# Wait for 10 seconds
|
|
||||||
sleep 10
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user