Skip to content

Commit 886642e

Browse files
markspolakovshitime1234
authored andcommitted
Actions: Build ARM64 dev base image (#1169)
* Actions: Build ARM64 dev base image * Remove xdebug from prod dockerfile and point error log to stderr * Fix apache crashing on startup
1 parent 0a61e10 commit 886642e

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

.github/workflows/dev-base-image.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,22 @@ jobs:
2929
- uses: actions/checkout@v2
3030
with:
3131
ref: ${{ github.event.inputs.ref || 'master' }}
32+
- name: Set up QEMU
33+
uses: docker/setup-qemu-action@v3
34+
35+
- name: Set up Docker Buildx
36+
uses: docker/setup-buildx-action@v3
37+
3238
- name: Docker Login
3339
uses: docker/login-action@v1.10.0
3440
with:
3541
registry: ghcr.io
3642
username: ${{ github.actor }}
3743
password: ${{ secrets.GITHUB_TOKEN }}
38-
- name: Build the Docker image
39-
run: docker build . --file Dockerfile --tag ghcr.io/universityradioyork/myradio/dev-base:${{ github.event.inputs.docker-tag || 'latest' }}
40-
- name: Push
41-
run: docker push ghcr.io/universityradioyork/myradio/dev-base:${{ github.event.inputs.docker-tag || 'latest' }}
44+
45+
- name: Build and push
46+
uses: docker/build-push-action@v6
47+
with:
48+
platforms: linux/amd64,linux/arm64
49+
push: true
50+
tags: ghcr.io/universityradioyork/myradio/dev-base:${{ github.event.inputs.docker-tag || 'latest' }}

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ RUN openssl req -nodes -new -subj "/C=GB/ST=North Yorkshire/L=York/O=University
3333

3434
RUN a2enmod rewrite ssl
3535

36+
# Fixes for running on ARM
37+
RUN echo "Mutex posixsem" >> /etc/apache2/apache2.conf
38+
3639
COPY sample_configs/apache.conf /etc/apache2/sites-available/myradio.conf
3740
RUN a2dissite 000-default && a2ensite myradio && \
3841
service apache2 restart && apachectl -S

Dockerfile.prod

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,6 @@ RUN docker-php-ext-install pgsql pdo_pgsql gd ldap curl xsl zip
99
RUN pecl install memcached && \
1010
echo extension=memcached.so >> /usr/local/etc/php/conf.d/memcached.ini
1111

12-
RUN pecl install xdebug-3.3.1 && docker-php-ext-enable xdebug \
13-
&& echo 'zend_extension="/usr/local/lib/php/extensions/no-debug-non-zts-20220829/xdebug.so"' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
14-
&& echo 'xdebug.client_port=9003' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
15-
&& echo 'xdebug.mode=develop,debug' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
16-
&& echo 'xdebug.start_with_request=yes' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
17-
&& echo 'xdebug.client_host=localhost' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
18-
1912
RUN echo 'error_reporting=E_ALL' >> /usr/local/etc/php/conf.d/error-reporting.ini
2013

2114
RUN echo "memory_limit=512M" >> /usr/local/etc/php/conf.d/uploads.ini
@@ -40,7 +33,8 @@ RUN a2dissite 000-default && a2ensite myradio && \
4033
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
4134

4235
RUN mkdir -p /var/www/myradio && chown -R www-data:www-data /var/www/myradio && \
43-
mkdir -p /var/log/myradio && chown -R www-data:www-data /var/log/myradio
36+
mkdir -p /var/log/myradio && chown -R www-data:www-data /var/log/myradio && \
37+
ln -s /var/log/myradio/errors.log /dev/stderr
4438

4539
WORKDIR /var/www/myradio
4640
COPY composer.* /var/www/myradio/

0 commit comments

Comments
 (0)