代码之家  ›  专栏  ›  技术社区  ›  John Beasley

docker php/mysql/apache容器

  •  1
  • John Beasley  · 技术社区  · 7 年前

    # 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
    

    基于上述情况,当我尝试运行以下命令时:

    docker run --name some-mysql -e MYSQL_abcd_123456=my-secret-pw -d mysql:tag
    

    我在终端中收到以下错误:

    Unable to find image 'mysql:tag' locally
    docker: Error response from daemon: manifest for mysql:tag not found.
    

    我错过了什么?

    1 回复  |  直到 7 年前
        1
  •  1
  •   Jimmix    7 年前

    用途:

    docker run --name some-mysql -e MYSQL_abcd_123456=my-secret-pw -d mysql:latest
    

    supported tags

    例如:

    5.7.25
    

    8.0.15
    
    推荐文章