Hi. I am new to docker and I never managed to dockerize anything.
I have a PyQt application that uses sqlachemy and a mariadb database that works properly on a virtual env that the dependencies file comes from.
Here the Dockerfile of my app
FROM fedora:38
ENV DISPLAY=:0
COPY . .
RUN dnf -y upgrade
RUN dnf -y install python3 python3-pip
RUN python3 -m pip install -r dependencies.txt
RUN dnf install -y mesa-libGLU libxkbcommon mesa-libEGL fontconfig dbus-libs xauth
CMD [ "python3", "main.py" ]
the dependencies.txt
attrs==23.1.0
blivet==3.7.1
greenlet==3.0.0a1
jsonpickle==3.0.1
jsonschema==4.17.3
PyMySQL==1.1.0
PyQt5-sip==12.12.1
PyQt6==6.5.1
PyQt6-Qt6==6.5.1
PyQt6-sip==13.5.1
pyrsistent==0.19.3
pyudev==0.24.1
six==1.16.0
SQLAlchemy==1.4.46
SQLAlchemy-Utils==0.39.0
typing_extensions==4.7.0rc1
and the docker-compose.yml file
version: "3"
services:
db:
container_name: mydb2
image: mariadb:latest
ports:
- "32001:3306"
environment:
MYSQL_ROOT_PASSWORD: root
app:
container_name: biere
links:
- "db"
build: ./
environment:
- DISPLAY=${DISPLAY}
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix
ports:
- "5001:5000"
The docker-compose build command succeeds but the docker-compose up gives me the error messages
[sudo] Mot de passe de jaaf :
Starting mydb2 ... done
Recreating biere ... done
Attaching to mydb2, biere
mydb2 | 2023-06-29 12:27:29+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:11.0.2+maria~ubu2204 started.
mydb2 | 2023-06-29 12:27:30+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
mydb2 | 2023-06-29 12:27:30+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:11.0.2+maria~ubu2204 started.
mydb2 | 2023-06-29 12:27:31+00:00 [Note] [Entrypoint]: MariaDB upgrade not required
mydb2 | 2023-06-29 12:27:31 0 [Note] Starting MariaDB 11.0.2-MariaDB-1:11.0.2+maria~ubu2204 source revision 0005f2f06c8e1aea4915887decad67885108a929 as process 1
mydb2 | 2023-06-29 12:27:31 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
mydb2 | 2023-06-29 12:27:31 0 [Note] InnoDB: Number of transaction pools: 1
mydb2 | 2023-06-29 12:27:31 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
mydb2 | 2023-06-29 12:27:31 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
mydb2 | 2023-06-29 12:27:31 0 [Note] InnoDB: Using liburing
mydb2 | 2023-06-29 12:27:31 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB
mydb2 | 2023-06-29 12:27:31 0 [Note] InnoDB: Completed initialization of buffer pool
mydb2 | 2023-06-29 12:27:31 0 [Note] InnoDB: File system buffers for log disabled (block size=512 bytes)
mydb2 | 2023-06-29 12:27:31 0 [Note] InnoDB: Opened 3 undo tablespaces
mydb2 | 2023-06-29 12:27:31 0 [Note] InnoDB: 128 rollback segments in 3 undo tablespaces are active.
mydb2 | 2023-06-29 12:27:31 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...
mydb2 | 2023-06-29 12:27:31 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
mydb2 | 2023-06-29 12:27:31 0 [Note] InnoDB: log sequence number 189094; transaction id 122
mydb2 | 2023-06-29 12:27:31 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
mydb2 | 2023-06-29 12:27:31 0 [Note] Plugin 'FEEDBACK' is disabled.
mydb2 | 2023-06-29 12:27:31 0 [Note] Plugin 'wsrep-provider' is disabled.
mydb2 | 2023-06-29 12:27:31 0 [Note] Server socket created on IP: '0.0.0.0'.
mydb2 | 2023-06-29 12:27:31 0 [Note] Server socket created on IP: '::'.
mydb2 | 2023-06-29 12:27:31 0 [Note] InnoDB: Buffer pool(s) load completed at 230629 12:27:31
mydb2 | 2023-06-29 12:27:31 0 [Note] mariadbd: ready for connections.
mydb2 | Version: '11.0.2-MariaDB-1:11.0.2+maria~ubu2204' socket: '/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution
biere | qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
biere | This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
biere |
biere | Available platform plugins are: vnc, minimal, wayland, minimalegl, linuxfb, offscreen, wayland-egl, vkkhrdisplay, xcb, eglfs.
biere |
mydb2 | 2023-06-29 12:27:32 4 [Warning] Aborted connection 4 to db: 'a_db' user: 'root' host: '172.20.0.3' (Got an error reading communication packets)
biere exited with code 139
Could somebody help me understanding what is wrong ? It seems that there is a problem to connect to the database and maybe to the X server.