Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable rust compile on dockerfile #1612

Merged
merged 6 commits into from
Mar 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 24 additions & 11 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: OctoBot-Docker
on:
push:
branches:
- 'master'
- 'dev'
- "master"
- "dev"
tags:
- '*'
- "*"
pull_request:

jobs:
Expand Down Expand Up @@ -58,10 +58,20 @@ jobs:
run: exit 1

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
id: qemu-setup
uses: docker/setup-qemu-action@master
with:
platforms: all

- name: Print available platforms
run: echo ${{ steps.qemu.outputs.platforms }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
id: buildx
uses: docker/setup-buildx-action@master
with:
driver: docker-container
use: true

- name: Cache Docker layers
uses: actions/cache@v2
Expand Down Expand Up @@ -92,14 +102,17 @@ jobs:
if: github.event_name == 'push' && steps.wait-for-main-build.outputs.conclusion == 'failure'
run: exit 1

- name: Build and push latest
- name: Build latest
if: github.event_name != 'push'
uses: docker/build-push-action@v2
uses: docker/build-push-action@master
with:
context: .
builder: ${{ steps.buildx.outputs.name }}
platforms: linux/amd64
load: true
platforms: linux/amd64,linux/arm/v7
# Using "load: true" forces the docker driver.
# Unfortunately, the "docker" driver does not support
# multi-platform builds.
# load: true
push: false
tags: ${{ env.IMAGE }}:${{ env.LATEST }}
build-args: |
Expand Down Expand Up @@ -134,7 +147,7 @@ jobs:

- name: Build and push latest
if: github.event_name == 'push' && !startsWith(github.ref, 'refs/tags') && github.ref == 'refs/heads/dev'
uses: docker/build-push-action@v2
uses: docker/build-push-action@master
with:
context: .
builder: ${{ steps.buildx.outputs.name }}
Expand All @@ -148,7 +161,7 @@ jobs:

- name: Build and push on tag
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: docker/build-push-action@v2
uses: docker/build-push-action@master
with:
context: .
file: ./Dockerfile
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
FROM python:3.8-slim-buster AS base

# requires git to install requirements with git+https
# requires rustc is required to build cryptography wheel
RUN apt-get update \
&& apt-get install -y --no-install-recommends build-essential git gcc libffi-dev libssl-dev libxml2-dev libxslt1-dev libxslt-dev libjpeg62-turbo-dev zlib1g-dev \
&& apt-get install -y rustc \
&& python -m venv /opt/venv

# skip cryptography rust compilation (required for armv7 builds)
ENV CRYPTOGRAPHY_DONT_BUILD_RUST=1

# Make sure we use the virtualenv:
ENV PATH="/opt/venv/bin:$PATH"

Expand Down