ubuntu下docker的lnmp(二) 安装php-fpm之 下载镜像启动容器

63 篇文章 0 订阅
11 篇文章 0 订阅

这里要说一下为什么非要自己去弄一个Ubuntu重新编译安装 php-fpm

我也知道docker官方源有 php-fpm

使用命令可以查很多

root@ccyy-virtual-machine:~# docker search php7
NAME                            DESCRIPTION                                     STARS               OFFICIAL            AUTOMATED
silintl/php7                    PHP7 with Apache running on Ubuntu              23                                      [OK]
mikechernev/php7-fpm-laravel    The latest PHP7-FPM with installed dependenc…   19                                      [OK]
adrianharabula/php7-with-oci8   Latest PHP 7.1 with apache and Oracle oci8      18                                      [OK]
phpdockerio/php72-fpm           PHP 7.2 FPM base container for PHPDocker.io.    17                                      [OK]
phpdockerio/php7-fpm            PHP 7 FPM base container for PHPDocker.io.      14                                      [OK]
ypereirareis/php7cc             Run php7cc from a docker container              10                                      [OK]
phpdockerio/php71-fpm           PHP 7.1 FPM base container for PHPDocker.io.    7                                       [OK]
phpdockerio/php73-fpm           PHP 7.3 FPM base container for PHPDocker.io.    7                                       
kwindsor/php7-apache-ubuntu     Start with the docker image php:7.0-apache a…   5                                       [OK]
phpdockerio/php72-cli           PHP 7.2 CLI base container for PHPDocker.io.    4                                       [OK]
eboost/php7fpm                  PHP7 FPM with all needed laravel extensions     3                                       [OK]
fromsmash/php7-fpm-symfony3     php7-fpm-symfony3                               2                                       [OK]
ccin2p3/php7-xdebug-sonar       Docker php7.0, xdebug and sonar                 1                                       [OK]
phpdockerio/php7-cli            PHP 7 CLI base container image for PHPDocker…   1                                       [OK]
phpdockerio/php71-cli           PHP 7.1 CLI base container for PHPDocker.io.    1                                       [OK]
eccube/php7-ext-codeception     Docker image for Codeception with additional…   1                                       [OK]
thomsch98/php7-composer         php7 installed on top of an Alpine base imag…   1                                       [OK]
w3media/php72-fpm               php72-fpm                                       1                                       [OK]
exadra37/php7-fpm               Default Docker Image for Php7 Fpm in https:/…   1                                       [OK]
tamtampro/php7                  php7 with media requirements                    1                                       [OK]
eksponent/php7                  PHP7+redis+xdebug                               1                                       [OK]
phpdockerio/php73-cli           PHP 7.3 CLI base container for PHPDocker.io.    0                                       
xddxdd/php7-fpm                 PHP7 FPM server built on Alpine                 0                                       
deinternetjongens/php7.1        PHP7.1 container for automated builds and de…   0                                       [OK]
epcallan/php7-testing-phpunit   Provides PHP7.0, PHP7.1, PHP7.2, and PHPUnit…   0                                       [OK]
root@ccyy-virtual-machine:~# 
 

然后我下了7.3  7.2 的php-fpm

然后发现,好像没myslqi 连phpmyadmin都运行不了,具体在php-fpm容器里安装支持php的扩展我也尝试了几天,好像没什么结果,懂的留言,我一定按照你的方法重新来一遍,我也不想编译安装 php-fpm 谁都不喜欢麻烦的事情

docker pull 速度慢的问题,替换

vim /etc/docker/daemon.json

添加下面的别丢中括号

{
    "registry-mirrors": ["https://pshk7r7h.mirror.swr.myhuaweicloud.com"]
}

接下来重启一下主机或者重启服务即可
systemctl daemon-reload

service docker restart

然后下载一个Ubuntu的,可以先用命令查看

root@ccyy-virtual-machine:~# docker search ubuntu
NAME                                                      DESCRIPTION                                     STARS               OFFICIAL            AUTOMATED
ubuntu                                                    Ubuntu is a Debian-based Linux operating sys…   10167               [OK]                
dorowu/ubuntu-desktop-lxde-vnc                            Docker image to provide HTML5 VNC interface …   362                                     [OK]
rastasheep/ubuntu-sshd                                    Dockerized SSH service, built on top of offi…   235                                     [OK]
consol/ubuntu-xfce-vnc                                    Ubuntu container with "headless" VNC session…   194                                     [OK]
ubuntu-upstart                                            Upstart is an event-based replacement for th…   100                 [OK]                
ansible/ubuntu14.04-ansible                               Ubuntu 14.04 LTS with ansible                   98                                      [OK]
1and1internet/ubuntu-16-nginx-php-phpmyadmin-mysql-5      ubuntu-16-nginx-php-phpmyadmin-mysql-5          50                                      [OK]
ubuntu-debootstrap                                        debootstrap --variant=minbase --components=m…   40                  [OK]                
nuagebec/ubuntu                                           Simple always updated Ubuntu docker images w…   24                                      [OK]
i386/ubuntu                                               Ubuntu is a Debian-based Linux operating sys…   18                                      
1and1internet/ubuntu-16-apache-php-5.6                    ubuntu-16-apache-php-5.6                        14                                      [OK]
1and1internet/ubuntu-16-apache-php-7.0                    ubuntu-16-apache-php-7.0                        13                                      [OK]
ppc64le/ubuntu                                            Ubuntu is a Debian-based Linux operating sys…   13                                      
1and1internet/ubuntu-16-nginx-php-phpmyadmin-mariadb-10   ubuntu-16-nginx-php-phpmyadmin-mariadb-10       11                                      [OK]
1and1internet/ubuntu-16-nginx-php-5.6                     ubuntu-16-nginx-php-5.6                         8                                       [OK]
1and1internet/ubuntu-16-nginx-php-5.6-wordpress-4         ubuntu-16-nginx-php-5.6-wordpress-4             7                                       [OK]
1and1internet/ubuntu-16-apache-php-7.1                    ubuntu-16-apache-php-7.1                        6                                       [OK]
darksheer/ubuntu                                          Base Ubuntu Image -- Updated hourly             5                                       [OK]
1and1internet/ubuntu-16-nginx-php-7.0                     ubuntu-16-nginx-php-7.0                         4                                       [OK]
pivotaldata/ubuntu                                        A quick freshening-up of the base Ubuntu doc…   2                                       
1and1internet/ubuntu-16-sshd                              ubuntu-16-sshd                                  1                                       [OK]
1and1internet/ubuntu-16-php-7.1                           ubuntu-16-php-7.1                               1                                       [OK]
pivotaldata/ubuntu16.04-build                             Ubuntu 16.04 image for GPDB compilation         1                                       
smartentry/ubuntu                                         ubuntu with smartentry                          1                                       [OK]
pivotaldata/ubuntu-gpdb-dev                               Ubuntu images for GPDB development              0                                       
root@ccyy-virtual-machine:~# 
 

看了半天,选了一个干净的

docker pull ubuntu

下载完可以查看下一下

 docker images

然后启动

【注意】:这里启动我卡了半天到一天,也就是没启动起来,然后没办法继续,系统没启动起来,怎么去编译,所以卡住了

后来还是基础的文章管用,无意看到了一个有用的文章直接放地址

Docker 安装 Ubuntu | 菜鸟教程 https://www.runoob.com/docker/docker-install-ubuntu.html

这个里面有一个命令解决了启动的问题

docker run -itd --name ubuntu-test ubuntu

就上面的这句,总算可以启动下载下来的镜像了

名字不用改了,后面打包可以随意改动,所以这里随意,先启动,赶紧编译安装才是主要的

启动容器

root@ccyy-virtual-machine:~# docker run -itd --name ubuntu-test ubuntu
76a72d3c7b085340aefdbb7c41b1f54d9dbd4844ba3a97832bb603ed3852ec20
root@ccyy-virtual-machine:~# 

设置跟随系统启动

root@ccyy-virtual-machine:~# docker update --restart=always ubuntu-test
ubuntu-test
root@ccyy-virtual-machine:~# 

进入到容器
root@ccyy-virtual-machine:~# docker exec -it ubuntu-test /bin/bash
root@76a72d3c7b08:/# 

这里就是容器内部了,可以随意折腾,如果出问题可以随时停止删除

》》下面一小段是如果容器被你搞的乱七八糟的,那么按下面的方法删除重新启动一个容器吧》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》

退出容器   在容器里面使用使用

root@76a72d3c7b08:/# exit
exit
 

然后按回车就可以了

如果想停止

root@ccyy-virtual-machine:~# docker stop ubuntu-test
ubuntu-test
root@ccyy-virtual-machine:~#

删除使用

root@ccyy-virtual-machine:~# docker rm ubuntu-test

《》《》《》《》《》《》《》《》《》《》《》《》《》《》《》《》《》《》

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值