-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(gha): various docker / docker-compose build improvements (#31386)
- Loading branch information
1 parent
a1adb7f
commit 3375e65
Showing
14 changed files
with
180 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: "Setup Docker Environment" | ||
description: "Reusable steps for setting up QEMU, Docker Buildx, DockerHub login, Supersetbot, and optionally Docker Compose" | ||
inputs: | ||
build: | ||
description: "Used for building?" | ||
required: false | ||
default: "false" | ||
dockerhub-user: | ||
description: "DockerHub username" | ||
required: false | ||
dockerhub-token: | ||
description: "DockerHub token" | ||
required: false | ||
install-docker-compose: | ||
description: "Flag to install Docker Compose" | ||
required: false | ||
default: "true" | ||
login-to-dockerhub: | ||
description: "Whether you want to log into dockerhub" | ||
required: false | ||
default: "true" | ||
outputs: {} | ||
runs: | ||
using: "composite" | ||
steps: | ||
|
||
- name: Set up QEMU | ||
if: ${{ inputs.build == 'true' }} | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
if: ${{ inputs.build == 'true' }} | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Try to login to DockerHub | ||
if: ${{ inputs.login-to-dockerhub == 'true' }} | ||
continue-on-error: true | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ inputs.dockerhub-user }} | ||
password: ${{ inputs.dockerhub-token }} | ||
|
||
- name: Install Docker Compose | ||
if: ${{ inputs.install-docker-compose == 'true' }} | ||
shell: bash | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y ca-certificates curl | ||
sudo install -m 0755 -d /etc/apt/keyrings | ||
# Download and save the Docker GPG key in the correct format | ||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg | ||
# Ensure the key file is readable | ||
sudo chmod a+r /etc/apt/keyrings/docker.gpg | ||
# Add the Docker repository using the correct key | ||
echo \ | ||
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ | ||
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ | ||
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | ||
# Update package lists and install Docker Compose plugin | ||
sudo apt update | ||
sudo apt install -y docker-compose-plugin | ||
- name: Docker Version Info | ||
shell: bash | ||
run: docker info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.