Hi, i have problem run pmm-agent in docker mysql container
my docker-compose file
version: ‘3.9’
services:
mysql:
container_name: mysql57
build:
context: ./images/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: passsuper
MYSQL_USER: ivan
MYSQL_DATABASE: dbinfor
MYSQL_PASSWORD: superpass
command: --default-authentication-plugin=mysql_native_password
my dockerfile for mysql (/images/mysql)
FROM mysql:5.7.33
ADD myconfig.cnf /etc/mysql/conf.d/myconfig.cnf
COPY percona-xtrabackup-80_8.0.22-15-1.buster_amd64.deb percona-xtrabackup-24_2.4.21-1.buster_amd64.deb pmm2-client_2.14.0-6.buster_amd64.deb pmm-agent.yaml /var/
RUN apt-get update && apt-get install -y libdbd-mysql-perl libcurl4-openssl-dev rsync libcurl4 libev4 procps
&& dpkg -i /var/percona-xtrabackup-24_2.4.21-1.buster_amd64.deb && DEBIAN_FRONTEND=noninteractive dpkg -i /var/pmm2-client_2.14.0-6.buster_amd64.deb
COPY entrypointr.sh /
RUN chmod +x /entrypointr.sh
#CMD /entrypointr.sh
RUN /entrypointr.sh
entrypointr.sh file
#!/bin/bash
pmm-agent --config-file=/var/pmm-agent.yaml
If I run docker-compose up -d, I get this error
But if I do it differently, then there is no mistake
Remove lines from dockerfile for mysql (/images/mysql)
COPY entrypointr.sh /
RUN chmod +x /entrypointr.sh
#CMD /entrypointr.sh
RUN /entrypointr.sh
Go to dockerterminal and run the command from there, then there are no errors
Actually the question is why can’t I start pmm-agent immediately when starting the container?