Hello,
I’m currently trying to build Custom images under docker-compose.
I get a lot of error messages and no matter what I install, there are errors.
I suspect something else is wrong with my approach
Maybe someone can help me. I’m still brand new among Docker users
My System is
Raspberry Pi 4
Raspberry original image
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
i have only a default Raspberry debian 64Bit image i dont have any apache or php instaled
thats mean i don’t have any folders created already on my system maybe what the instaltions need
There are my folders and docker-volume
/home/grobot/docker
looks like that
grobot@GRobotServer:~/docker $ ls -la
insgesamt 40
drwxr-xr-x 9 grobot grobot 4096 21. Feb 23:19 .
drwxr-xr-x 6 grobot grobot 4096 21. Feb 21:04 ..
drwxrwxrwx 2 www-data www-data 4096 21. Feb 22:03 apache
drwxr-xr-x 2 grobot grobot 4096 21. Feb 23:19 codeserver
-rw-r--r-- 1 grobot grobot 849 21. Feb 23:23 docker-compose.yml
drwxr-xr-x 3 root root 4096 21. Feb 19:15 influxDb
drwxr-xr-x 2 grobot grobot 4096 21. Feb 21:04 lamp
drwxr-xr-x 3 root root 4096 21. Feb 19:15 mariadb
drwxr-xr-x 3 root root 4096 21. Feb 19:14 php
drwxr-xr-x 6 www-data www-data 4096 21. Feb 19:14 www
Here is my docker-compose.yaml
ersion: "3.9"
volumes:
dbdata:
code:
services:
apache:
container_name: apache
build: apache
ports:
- 80:80
- 443:443
volumes:
- code:./www/html/
- ./apache/php-ini-overrides.ini:/usr/local/etc/php/conf.d/php-ini-overrides.ini
codeserver:
container_name: codeserver
image: ghcr.io/linuxserver/openssh-server
environment:
- PASSWORD_ACCESS=true
- USER_PASSWORD=secret
- USER_NAME=ssh
- PUID=1000
- PGID=33
ports:
- 22:2222
volumes:
- code:./www/html/
mariadb:
image: mariadb:latest
container_name: mariadb
ports:
- 3306:3306
environment:
- MYSQL_USER=root
- MYSQL_PASSWORD=secret
- MYSQL_ROOT_PASSWORD=secret
restart: always
volumes:
- dbdata:/var/lib/mysql
there is my Dockerfile
i try there a lot of samples… but i get only errors
FROM php:8-apache
LABEL maintainer "a210611@gmail.com"
LABEL description "HA_Webserver_Apache2"
# Umgebungsvariablen und Zeitzonen festlegen
#ENV TZ"EUROPE/BERLIN" \
# APACHE_RUN_USER=www-data \
# APACHE_RUN_GROUP=www-data \
# APACHE_LOG_DIR=/var/log/apache2
RUN pear config-set php_ini "$PHP_INI_DIR"
# Patch wegen freetype fehler
RUN apt-get update \
&& apt-get install -y \
&& pecl install xdebug \
&& 2enmod rewrite \
&& a2enmod headers
# RUN docker-php-ext-configure gd --with-freetype-dir --with-jpeg-dir=/usr/include/
RUN docker-php-ext-configure gd --with-freetype --with-jpeg
RUN docker-php-ext-install opcache gd pdo_mysql zip
RUN docker-php-ext-enable opcache gd xdebug zip
RUN echo "ServerName localhost" >> ./apache/apache2.conf
# RUN service apache2 restart
# Startkommando
CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]
There is my terminal output
i try to run docker-composer witzh this commands
docker-compose up -d
or
sudo docker-compose up
both not work
0 160.0 Libraries have been installed in:
#0 160.0 /tmp/pear/temp/pear-build-defaultuser81DoC2/xdebug-3.2.0/modules
#0 160.0
#0 160.0 If you ever happen to want to link against installed libraries
#0 160.0 in a given directory, LIBDIR, you must either use libtool, and
#0 160.0 specify the full pathname of the library, or use the `-LLIBDIR'
#0 160.0 flag during linking and do at least one of the following:
#0 160.0 - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
#0 160.0 during execution
#0 160.0 - add LIBDIR to the `LD_RUN_PATH' environment variable
#0 160.0 during linking
#0 160.0 - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
#0 160.0 - have your system administrator add LIBDIR to `/etc/ld.so.conf'
#0 160.0
#0 160.0 See any operating system documentation about shared libraries for
#0 160.0 more information, such as the ld(1) and ld.so(8) manual pages.
#0 160.0 ----------------------------------------------------------------------
#0 160.0
#0 160.1 Build complete.
#0 160.1 Don't forget to run 'make test'.
#0 160.1
#0 160.1 running: make INSTALL_ROOT="/tmp/pear/temp/pear-build-defaultuser81DoC2/install-xdebug-3.2.0" install
#0 160.1 Makefile:245: warning: overriding recipe for target 'test'
#0 160.1 Makefile:136: warning: ignoring old recipe for target 'test'
#0 160.4 Installing shared extensions: /tmp/pear/temp/pear-build-defaultuser81DoC2/install-xdebug-3.2.0/usr/local/lib/php/extensions/no-debug-non-zts-20220829/
#0 160.6
#0 160.7 shtool:echo:Warning: unable to determine terminal sequence for bold mode
#0 160.8 +----------------------------------------------------------------------+
#0 160.8 | |
#0 160.8 | INSTALLATION INSTRUCTIONS |
#0 160.8 | ========================= |
#0 160.8 | |
#0 160.8 | See https://xdebug.org/install.php#configure-php for instructions |
#0 160.8 | on how to enable Xdebug for PHP. |
#0 160.8 | |
#0 160.9 | Documentation is available online as well: |
#0 160.9 | - A list of all settings: https://xdebug.org/docs-settings.php |
#0 160.9 | - A list of all functions: https://xdebug.org/docs-functions.php |
#0 160.9 | - Profiling instructions: https://xdebug.org/docs-profiling2.php |
#0 160.9 | - Remote debugging: https://xdebug.org/docs-debugger.php |
#0 160.9 | |
#0 160.9 | |
#0 160.9 | NOTE: Please disregard the message |
#0 160.9 | You should add "extension=xdebug.so" to php.ini |
#0 160.9 | that is emitted by the PECL installer. This does not work for |
#0 160.9 | Xdebug. |
#0 160.9 | |
#0 161.0 +----------------------------------------------------------------------+
#0 161.1 shtool:echo:Warning: unable to determine terminal sequence for bold mode
#0 161.2
#0 161.2
#0 161.2 running: find "/tmp/pear/temp/pear-build-defaultuser81DoC2/install-xdebug-3.2.0" | xargs ls -dils
#0 161.2 653189 4 drwxr-xr-x 3 root root 4096 Feb 22 01:30 /tmp/pear/temp/pear-build-defaultuser81DoC2/install-xdebug-3.2.0
#0 161.2 653342 4 drwxr-xr-x 3 root root 4096 Feb 22 01:30 /tmp/pear/temp/pear-build-defaultuser81DoC2/install-xdebug-3.2.0/usr
#0 161.2 653343 4 drwxr-xr-x 3 root root 4096 Feb 22 01:30 /tmp/pear/temp/pear-build-defaultuser81DoC2/install-xdebug-3.2.0/usr/local
#0 161.2 653344 4 drwxr-xr-x 3 root root 4096 Feb 22 01:30 /tmp/pear/temp/pear-build-defaultuser81DoC2/install-xdebug-3.2.0/usr/local/lib
#0 161.2 653345 4 drwxr-xr-x 3 root root 4096 Feb 22 01:30 /tmp/pear/temp/pear-build-defaultuser81DoC2/install-xdebug-3.2.0/usr/local/lib/php
#0 161.2 653346 4 drwxr-xr-x 3 root root 4096 Feb 22 01:30 /tmp/pear/temp/pear-build-defaultuser81DoC2/install-xdebug-3.2.0/usr/local/lib/php/extensions
#0 161.2 653347 4 drwxr-xr-x 2 root root 4096 Feb 22 01:30 /tmp/pear/temp/pear-build-defaultuser81DoC2/install-xdebug-3.2.0/usr/local/lib/php/extensions/no-debug-non-zts-20220829
#0 161.2 653341 2084 -rwxr-xr-x 1 root root 2131208 Feb 22 01:30 /tmp/pear/temp/pear-build-defaultuser81DoC2/install-xdebug-3.2.0/usr/local/lib/php/extensions/no-debug-non-zts-20220829/xdebug.so
#0 161.2
#0 161.2 Build process completed successfully
#0 161.2 Installing '/usr/local/lib/php/extensions/no-debug-non-zts-20220829/xdebug.so'
#0 161.3 install ok: channel://pecl.php.net/xdebug-3.2.0
#0 161.3 cannot open php.ini "/usr/local/etc/php" for writing
#0 161.3 You should add "zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20220829/xdebug.so" to php.ini
#0 161.5 /bin/sh: 1: 2enmod: not found
------
Dockerfile:15
--------------------
14 | # Patch wegen freetype fehler
15 | >>> RUN apt-get update \
16 | >>> && apt-get install -y \
17 | >>> && pecl install xdebug \
18 | >>> && 2enmod rewrite \
19 | >>> && a2enmod headers
20 |
--------------------
ERROR: failed to solve: process "/bin/sh -c apt-get update && apt-get install -y && pecl install xdebug && 2enmod rewrite && a2enmod headers" did not complete successfully: exit code: 127
ERROR: Service 'apache' failed to build : Build failed
grobot@GRobotServer:~/docker $
The Error
cannot open php.ini “/usr/local/etc/php” for writing
is not possible because
i have there 777
ls -la /usr/local/etc/
drwxrwxrwx 3 root root 4096 22. Feb 01:43 php
ls -la /usr/local/etc/php
drwxrwxrwx 2 root root 4096 21. Feb 19:32 conf.d
-rwxrwxrwx 1 grobot grobot 102 22. Feb 02:01 php.ini
After what felt like the twentieth attempt, I had created the php.ini in the directory /usr/local/etc/php and php.ini file myself !!!
I thought it would be better then… but I was wrong
if the error message means
/bin/sh: 1: 2enmod: not found
same same with any freetype error… i installed on my raspberry system this modules already but not interested him
best reagards
achim
edit
there are my group-members
sudo:x:27:pi,grobot
audio:x:29:pi,grobot
dip:x:30:
www-data:x:33:grobot
backup:x:34:
operator:x:37:
list:x:38:
.
.
.
input:x:104:pi,grobot
kvm:x:105:
render:x:106:pi,grobot
crontab:x:107:
netdev:x:108:pi,grobot
.
.
grobot:x:1001:
docker:x:995:grobot,pi