-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from IamMrCupp:dev
Update Makefile for Docker Image Creation
- Loading branch information
Showing
3 changed files
with
141 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,121 @@ | ||
version: 2.1 | ||
|
||
workflows: | ||
build: | ||
jobs: | ||
- build: | ||
context: | ||
- esp-project | ||
|
||
jobs: | ||
build: | ||
build-dev: | ||
machine: | ||
image: ubuntu-2004:202104-01 | ||
environment: | ||
DOCKER_BUILDKIT: 1 | ||
BUILDX_PLATFORMS: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7,linux/riscv64,linux/386 | ||
BUILDX_PLATFORMS: linux/amd64,linux/arm64,linux/arm/v7 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Unit Tests | ||
command: make test | ||
name: Log in to docker hub | ||
command: | | ||
docker login -u $DOCKER_USER -p $DOCKER_PASS | ||
- run: | ||
name: Install buildx | ||
command: | | ||
BUILDX_BINARY_URL="https://github.com/docker/buildx/releases/download/v0.4.2/buildx-v0.4.2.linux-amd64" | ||
curl --output docker-buildx \ | ||
--silent --show-error --location --fail --retry 3 \ | ||
"$BUILDX_BINARY_URL" | ||
mkdir -p ~/.docker/cli-plugins | ||
mv docker-buildx ~/.docker/cli-plugins/ | ||
chmod a+x ~/.docker/cli-plugins/docker-buildx | ||
docker buildx install | ||
# Run binfmt | ||
docker run --rm --privileged tonistiigi/binfmt:latest --install "$BUILDX_PLATFORMS" | ||
- run: | ||
name: Login to Registry | ||
name: Make Images via Buildx | ||
command: | | ||
BUILDX_PLATFORMS="$BUILDX_PLATFORMS" make cross-build-dev | ||
build-master: | ||
machine: | ||
image: ubuntu-2004:202104-01 | ||
environment: | ||
DOCKER_BUILDKIT: 1 | ||
BUILDX_PLATFORMS: linux/amd64,linux/arm64,linux/arm/v7 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Log in to docker hub | ||
command: | | ||
docker login -u $DOCKER_USER -p $DOCKER_PASS | ||
- run: | ||
name: Build from Dockerfile | ||
name: Install buildx | ||
command: | | ||
TAG=edge make build | ||
BUILDX_BINARY_URL="https://github.com/docker/buildx/releases/download/v0.4.2/buildx-v0.4.2.linux-amd64" | ||
curl --output docker-buildx \ | ||
--silent --show-error --location --fail --retry 3 \ | ||
"$BUILDX_BINARY_URL" | ||
mkdir -p ~/.docker/cli-plugins | ||
mv docker-buildx ~/.docker/cli-plugins/ | ||
chmod a+x ~/.docker/cli-plugins/docker-buildx | ||
docker buildx install | ||
# Run binfmt | ||
docker run --rm --privileged tonistiigi/binfmt:latest --install "$BUILDX_PLATFORMS" | ||
- run: | ||
name: Make Images via Buildx | ||
command: | | ||
BUILDX_PLATFORMS="$BUILDX_PLATFORMS" make cross-build-latest | ||
build-tags: | ||
machine: | ||
image: ubuntu-2004:202104-01 | ||
environment: | ||
DOCKER_BUILDKIT: 1 | ||
BUILDX_PLATFORMS: linux/amd64,linux/arm64,linux/arm/v7 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Log in to docker hub | ||
command: | | ||
docker login -u $DOCKER_USER -p $DOCKER_PASS | ||
- run: | ||
name: Install buildx | ||
command: | | ||
BUILDX_BINARY_URL="https://github.com/docker/buildx/releases/download/v0.4.2/buildx-v0.4.2.linux-amd64" | ||
curl --output docker-buildx \ | ||
--silent --show-error --location --fail --retry 3 \ | ||
"$BUILDX_BINARY_URL" | ||
mkdir -p ~/.docker/cli-plugins | ||
mv docker-buildx ~/.docker/cli-plugins/ | ||
chmod a+x ~/.docker/cli-plugins/docker-buildx | ||
docker buildx install | ||
# Run binfmt | ||
docker run --rm --privileged tonistiigi/binfmt:latest --install "$BUILDX_PLATFORMS" | ||
- run: | ||
name: Make Images via Buildx | ||
command: | | ||
BUILDX_PLATFORMS="$BUILDX_PLATFORMS" make cross-build | ||
workflows: | ||
version: 2 | ||
build-branch-dev: | ||
jobs: | ||
- build-dev: | ||
context: | ||
- esp-project | ||
filters: | ||
branches: | ||
only: | ||
- dev | ||
build-branch-master: | ||
jobs: | ||
- build-master: | ||
context: | ||
- esp-project | ||
filters: | ||
branches: | ||
only: | ||
- master | ||
build-branch-tags: | ||
jobs: | ||
- build-tags: | ||
context: | ||
- esp-project | ||
filters: | ||
tags: | ||
only: | ||
- /^v.*/ | ||
branches: | ||
ignore: | ||
- /.*/ |
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