Skip to content

Commit

Permalink
Merge pull request #149 from YaoYinYing/master
Browse files Browse the repository at this point in the history
dockerfile for armhf linux
  • Loading branch information
vvbbnn00 authored Mar 15, 2024
2 parents 26b85f1 + b4fa7e6 commit 74b9f3e
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ docker-compose.yaml
README.md
LICENSE
logs/*.log
account/*.json
account/*.json
.idea
venv
15 changes: 14 additions & 1 deletion .github/workflows/docker_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
tags: |
type=sha,format=short
- name: Build and push
- name: Build and push (Dockerfile)
uses: docker/build-push-action@v5
with:
context: .
Expand All @@ -43,5 +43,18 @@ jobs:
build-args: GITHUB_ACTIONS=true
platforms: linux/amd64,linux/arm64

- name: Build and push (Dockerfile.armhf)
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile.armhf
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: GITHUB_ACTIONS=true
platforms: linux/arm/v7

- name: Image digest
run: echo ${{ steps.meta.outputs.digest }}
25 changes: 25 additions & 0 deletions Dockerfile.armhf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Use an official Python runtime as a parent image
FROM python:3.11-slim

WORKDIR /app

# Install Python dependencies
COPY requirements.txt ./

# Install Python, pip, necessary build dependencies,in one layer
RUN apt-get update && \
apt-get install -y libffi-dev libssl-dev build-essential && \
printf "[global]\nextra-index-url=https://www.piwheels.org/simple\n" > /etc/pip.conf && \
pip3 install --no-cache-dir -r requirements.txt && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Copy the rest of the code
COPY . .
RUN chmod +x ./scripts/*.sh

# Set environment variables
ENV RUN_IN_DOCKER=true

CMD ["/bin/sh", "./scripts/run.sh"]

0 comments on commit 74b9f3e

Please sign in to comment.