Reputation: 3075
Working with a Docker file which includes PHP, Apache, and MySQL. I was able to get the page to pull up in localhost. However, I am unable to get the MySQL running.
# Use an official PHP Apache runtime as a parent image
FROM php:7.0-apache
# Set the working directory to /var/www/html/
WORKDIR /var/www/html/
# Install mysqli extensions
RUN docker-php-ext-install mysqli && \
apt-get update && \
apt-get install -y zlib1g-dev && \
apt-get install -y libxml2-dev && \
docker-php-ext-install zip && \
docker-php-ext-install xml
# Make port 80 available to the world outside this container
EXPOSE 80
Based on the above, when I attempt to run the following command:
docker run --name some-mysql -e MYSQL_abcd_123456=my-secret-pw -d mysql:tag
I receive the following error in the terminal:
Unable to find image 'mysql:tag' locally
docker: Error response from daemon: manifest for mysql:tag not found.
What am I missing?
Upvotes: 2
Views: 648
Reputation: 6506
docker run command requires the image name parameter with optional version of the image (recommended).
Use:
docker run --name some-mysql -e MYSQL_abcd_123456=my-secret-pw -d mysql:latest
to pull the latest mysql image or choose the exact version listed by supported tags
for example:
5.7.25
or
8.0.15
In majority cases you should not use the tag with the version latest
(or skip the version) because that is ambiguous and can give you different versions of the image on two different machines even they used for the build the same Dockerfile FROM statement or you used the same docker run
(docker pull
) command. Read more
I would recommend always stick to the explicit version number if possible, for example:
docker run --name some-mysql -e MYSQL_abcd_123456=my-secret-pw -d mysql:8.0.15
Upvotes: 2