When I do docker build, an error occurs when the mysql client is installed on the web side.
I tried these articles. https://gist.github.com/sshymko/63ee4e9bc685c59a6ff548f1573b9c74 https://www.devopshint.com/install-mysql-5-7-on-amazon-linux-2/ Not able to install mysql-community-server on Amazon linux 2
#0 4.943 failure: repodata/repomd.xml from mysql57-community: [Errno 256] No more mirrors to try.
#0 4.943 http://repo.mysql.com/yum/mysql-5.7-community/el/7/aarch64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
------
failed to solve: executor failed running [/bin/sh -c yum -y install mysql-community-client]: exit code: 1
I'm getting an error with RUN yum -y install mysql-community-client.
dockerfile
FROM amazonlinux:2
RUN yum -y update
RUN rm -rf /etc/localtime
RUN cp /usr/share/zoneinfo/Japan /etc/localtime
#-------------------------------------------------
# Tools
#-------------------------------------------------
RUN yum install -y \
sudo \
wget \
tar \
unzip \
yum-utils \
git \
vim \
crontabs
#-------------------------------------------------
# Remi Repository Installation
#-------------------------------------------------
# RUN yum -y install epel-release
# RUN yum -y install http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
#-------------------------------------------------
# PHP7.0 & Apache 2.4 Installation
# see: https://weblabo.oscasierra.net/centos7-php70-install/
#-------------------------------------------------
RUN yum -y install httpd php70 php70-php \
php \
php-devel \
php-mbstring \
php-pdo \
php-gd \
php-xml \
php-pear \
php-mcrypt \
php-zip \
php-mysql \
php-cli \
php-common \
php-pecl-apcu \
php-pecl-zendopcache \
php-intl
#-------------------------------------------------
# composer
#-------------------------------------------------
COPY ./files/composer.phar /usr/local/bin/composer
RUN chmod 777 /usr/local/bin/composer
#-------------------------------------------------
# Apache Enable & Start
#-------------------------------------------------
# RUN systemctl enable httpd.service \
# systemctl start httpd.service
#-------------------------------------------------
# MySQL
#-------------------------------------------------
RUN yum install -y https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
RUN yum-config-manager --disable mysql80-community
RUN sudo yum-config-manager --enable mysql57-community
RUN yum -y install mysql-community-client
#-------------------------------------------------
# config
#-------------------------------------------------
RUN cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf_org
COPY ./files/httpd.conf /etc/httpd/conf/httpd.conf
COPY ./files/dev.conf /etc/httpd/conf.d/dev.conf
RUN chmod 644 /etc/httpd/conf/httpd.conf /etc/httpd/conf.d/*.conf
CMD ["/sbin/init"]
dockercompose.yml
version: "3"
services:
web:
build: ./docker/web
container_name: test_web
ports:
- "8080:80"
volumes:
- ./:/var/www/marriage-member
working_dir: /var/www/marriage-member
privileged: true
depends_on:
- db
db:
build: ./docker/db
container_name: test_db
ports:
- 3306:3306
# for m1 mac
platform: linux/x86_64
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: test_db
MYSQL_PASSWORD: test_db
MYSQL_DATABASE: test_db
volumes:
- db-data:/var/lib/mysql
volumes:
db-data:
driver: local
m1-macos local development apache2.4 mysql5.7