blob: 4023fdb93dccf434125b5a843b211eb9599cbd03 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
# syntax=docker/dockerfile:experimental
ARG arch=armhf
FROM ownyourbits/debian-ncp-${arch}
LABEL maintainer="Ignacio Núñez Hernanz <nacho@ownyourbits.com>"
SHELL ["/bin/bash", "-c"]
ENV DOCKERBUILD 1
COPY etc/ncp.cfg etc/library.sh lamp.sh /usr/local/etc/
RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/apt \
# installation
apt-get update; \
apt-get install --no-install-recommends -y jq; \
source /usr/local/etc/library.sh; \
set +x; \
install_app /usr/local/etc/lamp.sh; \
# stop mysqld
mysqladmin -u root shutdown; \
# mariaDB fixups (move database to /data-ro, which will be in a persistent volume)
mkdir -p /data-ro /data; \
mv /var/lib/mysql /data-ro/database; \
sed -i "s|^datadir.*|datadir = /data-ro/database|" /etc/mysql/mariadb.conf.d/90-ncp.cnf; \
# package cleanup
apt-get autoremove -y; \
apt-get clean; \
find /var/lib/apt/lists -type f | xargs rm; \
rm -rf /usr/share/man/*; \
rm -rf /usr/share/doc/*; \
rm /var/cache/debconf/*-old; \
rm -f /var/log/alternatives.log /var/log/apt/*; \
# specific cleanup
rm /data-ro/database/ib_logfile*; \
rm /usr/local/etc/lamp.sh
COPY docker/lamp/010lamp /etc/services-enabled.d/
ENTRYPOINT ["/run-parts.sh"]
EXPOSE 80 443
|