Linux Mastering Development

trying to install mysql 5.7 in a docker image in ubuntu machine

when trying to install mysql 5.7 in docker container, I am getting the following error, I am new to dockers and containers can someone pls guide me

Step 16/23 : RUN apt-get install mysql-server-5.7
  ---> Running in 9624e9df68e7
 Reading package lists...
 Building dependency tree...
 Reading state information...
 Package mysql-server-5.7 is not available, but is referred to by another package.
 This may mean that the package is missing, has been obsoleted, or
 is only available from another source
 However the following packages replace it:
 E: Package 'mysql-server-5.7' has no installation candidate
 Service 'web' failed to build: The command '/bin/sh -c apt-get install mysql-server-5.7' returned a non-zero code: 100
 ERROR: Job failed: exit status 1

My docker file


FROM ubuntu:latest
RUN DEBIAN_FRONTEND=noninteractive
RUN apt-get upgrade
RUN apt-get update
RUN apt-get install -y wget 
RUN wget
RUN apt-get install -y nodejs
RUN apt-get install -y npm
RUN apt-get install -y prometheus

RUN apt-get install -y openjdk-8-jdk
RUN wget -qO - | apt-key add -
RUN sh -c 'echo "deb stable main" > /etc/apt/sources.list.d/elastic-7.x.list' 
RUN apt-get update 
RUN apt-get install -y elasticsearch
RUN apt-get install -y mongodb
RUN apt-get install mysql-server-5.7
RUN mkdir -p -v /data/db
WORKDIR /home/ubuntu/Github-MICROSERVICE/
COPY package*.json ./
RUN npm install
COPY . .
CMD chown -R mysql:mysql /var/lib/mysql \
&& service mysql start \
&& mysql -ppassword -e "CREATE DATABASE IF NOT EXISTS ted;GRANT ALL PRIVILEGES on ted.* TO 'root'@'localhost' WITH GRANT OPTION; ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';FLUSH PRIVILEGES;SET GLOBAL connect_timeout=28800;SET GLOBAL sql_mode='NO_ENGINE_SUBSTITUTION';" \
&& service prometheus start \
&& service mongodb start\
&& npm start


Leave a Reply

Your email address will not be published. Required fields are marked *