Merge pull request #2281 from knorrium/knorrium/fix_docker_gha_oom
Fix the OOM issue when building the frontend docker image for armv7
This commit is contained in:
commit
f618f12515
34
.github/workflows/on-tag.yml
vendored
34
.github/workflows/on-tag.yml
vendored
@ -1,7 +1,7 @@
|
|||||||
name: Docker build on tag
|
name: Docker build on tag
|
||||||
env:
|
env:
|
||||||
DOCKER_CLI_EXPERIMENTAL: enabled
|
DOCKER_CLI_EXPERIMENTAL: enabled
|
||||||
TAG_FMT: '^refs/tags/(((.?[0-9]+){3,4}))$'
|
TAG_FMT: "^refs/tags/(((.?[0-9]+){3,4}))$"
|
||||||
DOCKER_BUILDKIT: 0
|
DOCKER_BUILDKIT: 0
|
||||||
COMPOSE_DOCKER_CLI_BUILD: 0
|
COMPOSE_DOCKER_CLI_BUILD: 0
|
||||||
|
|
||||||
@ -21,9 +21,39 @@ jobs:
|
|||||||
service:
|
service:
|
||||||
- frontend
|
- frontend
|
||||||
- backend
|
- backend
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 120
|
||||||
name: Build and push to DockerHub
|
name: Build and push to DockerHub
|
||||||
steps:
|
steps:
|
||||||
|
# Workaround based on JonasAlfredsson/docker-on-tmpfs@v1.0.1
|
||||||
|
- name: Replace the current swap file
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
sudo swapoff /mnt/swapfile
|
||||||
|
sudo rm -v /mnt/swapfile
|
||||||
|
sudo fallocate -l 10G /mnt/swapfile
|
||||||
|
sudo chmod 600 /mnt/swapfile
|
||||||
|
sudo mkswap /mnt/swapfile
|
||||||
|
sudo swapon /mnt/swapfile
|
||||||
|
|
||||||
|
- name: Show current memory and swap status
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
sudo free -h
|
||||||
|
echo
|
||||||
|
sudo swapon --show
|
||||||
|
|
||||||
|
- name: Mount a tmpfs over /var/lib/docker
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
if [ ! -d "/var/lib/docker" ]; then
|
||||||
|
echo "Directory '/var/lib/docker' not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
sudo mount -t tmpfs -o size=10G tmpfs /var/lib/docker
|
||||||
|
sudo systemctl restart docker
|
||||||
|
sudo df -h | grep docker
|
||||||
|
|
||||||
- name: Set env variables
|
- name: Set env variables
|
||||||
run: echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
|
run: echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user