Out-of-the-box LAMP image (PHP+MySQL)
To create the image tutum/lamp, execute the following command on the tutum-docker-lamp folder:
docker build -t tutum/lamp .
You can now push your new image to the registry:
docker push tutum/lamp
Start your image binding the external ports 80 and 3306 in all interfaces to your container:
docker run -d -p 80:80 -p 3306:3306 tutum/lamp
Test your deployment:
curl http://localhost/
Hello world!
In order to replace the "Hello World" application that comes bundled with this docker image,
create a new Dockerfile in an empty folder with the following contents:
FROM tutum/lamp:latest RUN rm -fr /app && git clone https://github.com/username/customapp.git /app EXPOSE 80 3306 CMD ["/run.sh"]
replacing https://github.com/username/customapp.git with your application's GIT repository.
After that, build the new Dockerfile:
docker build -t username/my-lamp-app .
And test it:
docker run -d -p 80:80 -p 3306:3306 username/my-lamp-app
Test your deployment:
curl http://localhost/
That's it!
The bundled MySQL server has a root user with no password for local connections.
Simply connect from your PHP code with this user:
<?php $mysql = new mysqli("localhost", "root"); echo "MySQL Server info: ".$mysql->host_info; ?>
The first time that you run your container, a new user admin with all privileges
will be created in MySQL with a random password. To get the password, check the logs
of the container by running:
docker logs $CONTAINER_ID
You will see an output like the following:
======================================================================== You can now connect to this MySQL Server using: mysql -uadmin -p47nnf4FweaKu -h<host> -P<port> Please remember to change the above password as soon as possible! MySQL user 'root' has no password but only allows local connections ========================================================================
In this case, 47nnf4FweaKu is the password allocated to the admin user.
You can then connect to MySQL:
mysql -uadmin -p47nnf4FweaKu
Remember that the root user does not allow connections from outside the container -
you should use this admin user instead!
If you want to use a preset password instead of a random generated one, you can
set the environment variable MYSQL_PASS to your specific password when running the container:
docker run -d -p 80:80 -p 3306:3306 -e MYSQL_PASS="mypass" tutum/lamp
You can now test your new admin password:
mysql -uadmin -p"mypass"
.htaccess is enabled by default. To disable .htaccess, you can remove the following contents from Dockerfile
# config to enable .htaccess ADD apache_default /etc/apache2/sites-available/000-default.conf RUN a2enmod rewrite
by [*]





探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务