本篇內(nèi)容主要講解“安裝docker和laradoc要注意什么”,感興趣的朋友不妨來(lái)看看。本文介紹的方法操作簡(jiǎn)單快捷,實(shí)用性強(qiáng)。下面就讓小編來(lái)帶大家學(xué)習(xí)“安裝docker和laradoc要注意什么”吧!
專業(yè)成都網(wǎng)站建設(shè)公司,做排名好的好網(wǎng)站,排在同行前面,為您帶來(lái)客戶和效益!創(chuàng)新互聯(lián)為您提供成都網(wǎng)站建設(shè),五站合一網(wǎng)站設(shè)計(jì)制作,服務(wù)好的網(wǎng)站設(shè)計(jì)公司,網(wǎng)站建設(shè)、成都網(wǎng)站設(shè)計(jì)負(fù)責(zé)任的成都網(wǎng)站制作公司!
安裝最新的docker-compose
1,centos7.0 安裝的日志
111 sudo yum install -y yum-utils device-mapper-persistent-data lvm2
798 yum-config-manager --add-repo https://mirrors.ustc.edu.cn/docker-ce/linux/centos/docker-ce.repo
799 docker-compose --version
802 yum remove docker-compose
803 sudo curl -L "https://github.com/docker/compose/releases/download/1.23.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
804 chmod +x /usr/local/bin/docker-compose
805 docker-compose --version
807 chmod +x /usr/local/bin/docker-compose
810 which docker-compose
811 /usr/local/bin/docker-compose
815 rm /usr/bin/docker-compose -rf
817 ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
818 docker-compose
819 docker-compose up caddy postgres
823 ps -ef | grep 80
##下面是原來(lái)安裝了bt的,可以忽略
824 /etc/init.d/bt stop
825 /etc/init.d/nginx stop
826 /etc/init.d/php-fpm-56 stop
##從這開始始
827 docker-compose up caddy postgres
2,進(jìn)入工作空間前,請(qǐng)確認(rèn)環(huán)境已經(jīng)啟動(dòng)
docker-compose exec workspace bash 【報(bào)權(quán)限錯(cuò)誤】,加參 --user=laradock
docker-compose exec --user=laradock workspace bash
會(huì)進(jìn)入 /var/www 目錄
此時(shí) 可以執(zhí)行composer 和PHP命令。
如果之前env-example 開啟了node和yarn 也可執(zhí)行對(duì)應(yīng)命令。
3,安裝notadd (一直沒有安裝成功)
(注:很多文檔說(shuō)下載是git clone https://github.com/notadd/notadd.git,但是找不到public文件。后來(lái)看到有https://gitee.com/stamhe/notadd/ ,就從這下載了)
$ cd notadd $ composer install $ php notadd vendor:publish --force
------------------------------------------------------------------------------------------------------------
composer Content-Length mismatch 坑
------------------------------------------------------------------------------------------------------------
[root@localhost docker]# docker-compose exec --user=laradock workspace bash
laradock@f38202628d46:/var/www$ composer install
Composer could not find a composer.json file in /var/www
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
laradock@f38202628d46:/var/www$ cd notadd
laradock@f38202628d46:/var/www/notadd$ composer install
Loading composer repositories with package information
Updating dependencies (including require-dev)
.... 時(shí)間是很長(zhǎng),估計(jì)5分鐘
composer update 出現(xiàn)如下錯(cuò)誤:
[Composer\Downloader\TransportException] Content-Length mismatch
解決:
更換源:
composer config repo.packagist composer https://packagist.phpcomposer.com (壞了)
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer
如果更換了源,還是不通過(guò)。就表示是網(wǎng)速問(wèn)題。
---------------------------------------------------------------------------------
[root@localhost docker]# docker-compose images
ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?
..........
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
[root@localhost docker]# systemctl start docker.service
[root@localhost docker]# docker-compose images
docker MySQL 的坑處理
[root@localhost docker]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
749b4031b2da e12a2860ec4a "/bin/sh -c 'if [ ${…" 13 minutes ago Up 13 minutes frosty_roentgen
78dd491ef5c1 laradock_mysql "docker-entrypoint.s…" 33 minutes ago Up 11 minutes 0.0.0.0:3306->3306/tcp, 33060/tcp laradock_mysql_1_b66ee05935fb
[root@localhost docker]#
[root@localhost docker]# docker exec -it 78dd491ef5c1 bash
root@78dd491ef5c1:/#
root@78dd491ef5c1:/# mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
root@78dd491ef5c1:/# mysql -uroot -proot
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.18 MySQL Community Server - GPL
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> exit;
這使用windows 客戶端工具mysql Sqlyog連接報(bào)1251錯(cuò)誤。處理見:https://blog.csdn.net/qq_36068954/article/details/80175755
[root@localhost docker]# docker exec -it 78dd491ef5c1 bash
root@78dd491ef5c1:/# mysql -uroot -p
mysql> use mysql;
mysql> ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'password';
Query OK, 0 rows affected (0.01 sec)
mysql> ALTER USER 'root'@'%' IDENTIFIED BY 'root' PASSWORD EXPIRE NEVER;
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
修改完成,用sqlyog測(cè)試ip:192.168.137.103 root ps:root 端口:3306 ,通過(guò)成功。
-----------------------------------------------------------------------------------------------------
在laravel使用php artisan make:auth,提示未定義。這有可能使用了git clone安裝版本不對(duì)。后面通過(guò) Laravel 安裝器
-----------------------------------------------------------------------------------------------------
#docker-compose exec --user=laradock workspace bash
laradock@86eb8724d279:/var/www/laravel$ composer config -g repo.packagist composer https://mirrors.aliyun.com/composer
laradock@86eb8724d279:/var/www/laravel$ composer update
Loading composer repositories with package information
------------------------------------------------------------------------------------------------
首先,通過(guò)使用 Composer 安裝 Laravel 安裝器:
composer global require laravel/installer
-----------------------------------------------------------------------------------------------------
安裝laravel5.8中文文檔:https://learnku.com/docs/laravel/5.8/installation/3879
選擇通過(guò) Composer 創(chuàng)建項(xiàng)目(這一種辦法即可)
在終端中運(yùn)行 create-project 命令來(lái)安裝 Laravel:
composer create-project --prefer-dist laravel/laravel blog "5.8.*"
3. 使用composer創(chuàng)建laravel項(xiàng)目,http://silsuer.cn/2018/01/17/laravel-docker-env-windows/
------------------------------------------------------------------------------------------------
在本地電腦的虛擬機(jī)內(nèi)使用composer一直報(bào)
[Composer\Downloader\TransportException] 錯(cuò)誤,花了一整天的時(shí)間調(diào)整composer,估計(jì)是本地網(wǎng)絡(luò)過(guò)慢。
-----------------------------------------------------------------------------------------------------
只好從安裝的本地電腦能使用php artisan make:auth的環(huán)境,整體將本地電腦laravel目錄打包為zip,放進(jìn)虛擬機(jī)內(nèi)。
使用
#docker-compose exec --user=laradock workspace bash
laradock@86eb8724d279:/var/www/laravel$ php artisan make:auth
The [auth/login.blade.php] view already exists. Do you want to replace it? (yes/no) [no]:
> n
由于原來(lái)有此文件,上面表示成功了。
參考:
https://gitee.com/stamhe/notadd/
https://learnku.com/articles/15197/laradock-portal-configuration
到此,相信大家對(duì)“安裝docker和laradoc要注意什么”有了更深的了解,不妨來(lái)實(shí)際操作一番吧!這里是創(chuàng)新互聯(lián)網(wǎng)站,更多相關(guān)內(nèi)容可以進(jìn)入相關(guān)頻道進(jìn)行查詢,關(guān)注我們,繼續(xù)學(xué)習(xí)!
網(wǎng)站欄目:安裝docker和laradoc要注意什么
URL網(wǎng)址:http://jinyejixie.com/article8/ghheip.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供外貿(mào)建站、全網(wǎng)營(yíng)銷推廣、響應(yīng)式網(wǎng)站、商城網(wǎng)站、靜態(tài)網(wǎng)站、標(biāo)簽優(yōu)化
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)