Skip to content

Commit

Permalink
fix(572): arm docker build (#609)
Browse files Browse the repository at this point in the history
  • Loading branch information
DDtKey committed Dec 22, 2022
1 parent 469e9ea commit 15c5bfb
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 25 deletions.
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[net]
git-fetch-with-cli = true
14 changes: 5 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,20 +184,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# TODO: https://github.com/dotenv-linter/dotenv-linter/issues/572
# To build cross-platform images
#- name: Set up QEMU
# uses: docker/setup-qemu-action@v2
# with:
# platforms: arm64
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# TODO: https://github.com/dotenv-linter/dotenv-linter/issues/572
#- run: |
# docker buildx build --platform linux/amd64,linux/arm64 -f Dockerfile -t dotenvlinter/dotenv-linter .
- run: |
docker buildx build --platform linux/amd64 -f Dockerfile -t dotenvlinter/dotenv-linter .
docker buildx build --platform linux/amd64,linux/arm64 -f Dockerfile -t dotenvlinter/dotenv-linter .
####################
### Check builds ###
Expand Down
20 changes: 6 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,28 +130,20 @@ jobs:
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# TODO: https://github.com/dotenv-linter/dotenv-linter/issues/572
# To build cross-platform images
#- name: Set up QEMU
# uses: docker/setup-qemu-action@v2
# with:
# platforms: arm64
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# TODO: https://github.com/dotenv-linter/dotenv-linter/issues/572
#- name: Build and push image
# run: |
# GIT_TAG=$(git describe --tags `git rev-list --tags --max-count=1` | sed "s/v//")
#
# docker buildx build --push --platform linux/amd64,linux/arm64 -f Dockerfile -t dotenvlinter/dotenv-linter:${GIT_TAG} .
# docker buildx build --push --platform linux/amd64,linux/arm64 -f Dockerfile -t dotenvlinter/dotenv-linter:latest .
- name: Build and push image
run: |
GIT_TAG=$(git describe --tags `git rev-list --tags --max-count=1` | sed "s/v//")
docker buildx build --push --platform linux/amd64 -f Dockerfile -t dotenvlinter/dotenv-linter:${GIT_TAG} .
docker buildx build --push --platform linux/amd64 -f Dockerfile -t dotenvlinter/dotenv-linter:latest .
docker buildx build --push --platform linux/amd64,linux/arm64 -f Dockerfile -t dotenvlinter/dotenv-linter:${GIT_TAG} .
docker buildx build --push --platform linux/amd64,linux/arm64 -f Dockerfile -t dotenvlinter/dotenv-linter:latest .
release-crate:
runs-on: ubuntu-latest
Expand Down
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
FROM messense/rust-musl-cross:x86_64-musl as builder

WORKDIR /

RUN cargo new dotenv-linter
COPY Cargo.toml ./
COPY src ./src
COPY benches ./benches
COPY src src
COPY benches benches
COPY .cargo .cargo

RUN cargo build --release
RUN cargo install --target x86_64-unknown-linux-musl --path .
Expand Down

0 comments on commit 15c5bfb

Please sign in to comment.