Home > Software design >  docker desktop run automatically a container into an docker compose structure
docker desktop run automatically a container into an docker compose structure

Time:11-16

Each time I start my docker desktop application into Windows 11 OS,

It launch automatically a container into a docker-compose structure.

But not the others containers into this docker-compose.

I dealing with a MariaDB container...

My Apache container and my PHP container not run automatically. Just MariaDB

This is my docker-compose.yml file :

    version: '3'

services:

    apache:
        build: ./docker/apache
        container_name: projectx_apache
        tty: true
        ports:
            - '443:443'
        depends_on:
            - php
            - mariadb
        volumes:
            - ./:/var/www/projectx/

    php:
        build: ./docker/php
        container_name: projectx_php
        tty: true
        volumes:
            - ./:/var/www/projectx/

    mariadb:
        build: ./docker/mariadb
        container_name: projectx_mariadb
        restart: always
        tty: true
        environment:
            MYSQL_ROOT_PASSWORD: docker
            MYSQL_DATABASE: projectx
            MYSQL_USER: docker
            MYSQL_PASSWORD: docker
        ports:
            - '3306:3306'

this is my Dockerfile for MariaDB container :

FROM mariadb:latest

ENV MYSQL_ROOT_PASSWORD docker
ENV MYSQL_DATABASE projectx
ENV MYSQL_USER root
ENV MYSQL_PASSWORD docker

RUN apt-get -y update
RUN apt-get -y install vim

EXPOSE 3310

CMD ["mysqld"]

And this is my log container when It start automatically :

2022-11-15 14:16:33 00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.9.4 maria~ubu2204 started.
2022-11-15 14:16:33 00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-11-15 14:16:33 00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.9.4 maria~ubu2204 started.
2022-11-15 14:16:34 00:00 [Note] [Entrypoint]: MariaDB upgrade not required
2022-11-15 14:16:34 0 [Note] mysqld (server 10.9.4-MariaDB-1:10.9.4 maria~ubu2204) starting as process 1 ...
2022-11-15 14:16:34 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-11-15 14:16:34 0 [Note] InnoDB: Number of transaction pools: 1
2022-11-15 14:16:34 0 [Note] InnoDB: Using crc32   pclmulqdq instructions
2022-11-15 14:16:34 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
2022-11-15 14:16:34 0 [Warning] mysqld: io_uring_queue_init() failed with ENOMEM: try larger memory locked limit, ulimit -l, or https://mariadb.com/kb/en/systemd/#configuring-limitmemlock under systemd (262144 bytes required)
2022-11-15 14:16:34 0 [Warning] InnoDB: liburing disabled: falling back to innodb_use_native_aio=OFF
2022-11-15 14:16:34 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB
2022-11-15 14:16:34 0 [Note] InnoDB: Completed initialization of buffer pool
2022-11-15 14:16:34 0 [Note] InnoDB: File system buffers for log disabled (block size=4096 bytes)
2022-11-15 14:16:34 0 [Note] InnoDB: 128 rollback segments are active.
2022-11-15 14:16:34 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...
2022-11-15 14:16:34 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
2022-11-15 14:16:34 0 [Note] InnoDB: log sequence number 1489638494; transaction id 8288
2022-11-15 14:16:34 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2022-11-15 14:16:34 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-11-15 14:16:34 0 [Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.
2022-11-15 14:16:34 0 [Note] Server socket created on IP: '0.0.0.0'.
2022-11-15 14:16:34 0 [Note] Server socket created on IP: '::'.
2022-11-15 14:16:34 0 [Note] mysqld: ready for connections.
Version: '10.9.4-MariaDB-1:10.9.4 maria~ubu2204'  socket: '/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
2022-11-15 14:16:34 0 [Note] InnoDB: Buffer pool(s) load completed at 221115 14:16:34

Do you have an idea why this container start automatically ?

CodePudding user response:

The reason for automatic start here is restart: always on MariaDB container,
It will start the container when the docker daemon restart. See restart policy

  • Related