我在Ubuntu上检查了Docker的文档页面,但是我没有看到最近发布的18.04.
https://docs.docker.com/install/linux/docker-ce/ubuntu/
有人在18.04安装了docker吗?
更新:docker文档现已更新,包括18.04
这是我的文件夹结构:
+-- root-app-dir
| +-- docker
| | +-- Dockerfile
| | +-- nginx.conf
| +-- src // this is where the Laravel app lives
| +-- docker-compose.yml
Run Code Online (Sandbox Code Playgroud)
这是我的 docker-compose.yml
version: '2'
services:
app:
build:
context: ./docker
dockerfile: Dockerfile
image: lykos/laravel
volumes:
- ./src/:/var/www/html/
networks:
- app-network
nginx:
image: nginx:latest
volumes:
- ./src/:/var/www/html/
- ./docker/nginx.conf:/etc/nginx/conf.d/default.conf
ports:
- 8000:80
networks:
- app-network
mysql:
image: mysql:5.7
ports:
- "4306:3306"
environment:
MYSQL_DATABASE: homestead
MYSQL_USER: homestead
MYSQL_PASSWORD: secret
MYSQL_ROOT_PASSWORD: secret
volumes:
- mysqldata:/var/lib/mysql
networks: …
Run Code Online (Sandbox Code Playgroud) 我<input type="file" />
在Google Chrome中遇到HTML标记问题.
"浏览"按钮按预期显示在页面上,但是当我单击它以选择文件时,浏览器中的弹出对话框窗口根本不会打开.
我测试了我的表单并在Firefox中正常工作.任何想法有什么问题,我该如何解决?
这里也是代码:
<form action="" method="post" accept-charset="utf-8" enctype="multipart/form-data">
<label for="imgfile">File input</label>
<input type="file" name="imgfile" />
Run Code Online (Sandbox Code Playgroud) 我目前正在尝试在我的工作流程中学习使用Git,我想问一下我如何更容易地做到这些.
我经常创造不同的分支,以便做一些事情,看看它们是否适合我.当我切换分支时,如何将工作目录保存在上次提交的文件和文件夹中?因此,例如当我从branch_A切换到master时,我的工作目录将拥有我在上一次提交的文件夹和文件,或者当我切换到branch_B时,我的工作目录将包含所有来自branch_B等的最后一次提交
我将这个json存储在数据库中
{
"endDate": "2018-10-10",
"startDate": "2017-09-05",
"oldKeyValue": {
"foo": 1000,
"bar": 2000,
"baz": 3000
},
"anotherValue": 0
}
Run Code Online (Sandbox Code Playgroud)
如何"oldKeyValue"
在"newKeyValue"
不知道UPDATE
查询中键索引的情况下将键重命名为?我正在寻找这样的东西
UPDATE `my_table` SET `my_col` = JSON()
Run Code Online (Sandbox Code Playgroud)
注意:只有密钥需要更改,值(即{"foo": 1000, "bar": 2000, "baz": 3000}
)应保持不变
我想要做的是加载库,如果它们尚未加载(CI的库,或者是自定义的库)在网站的许多不同点上.所以我想对此进行检查.
我已经在Loader库上搜索并找到了is_loaded()函数,所以我可以这样做:
if ($this->load->is_loaded('form_validation') === false) {
$this->load->library('form_validation');
}
Run Code Online (Sandbox Code Playgroud)
这个奇怪的事情(启用了探查器)是内存上升,这让我想知道这是不是正确的方式.
我想请一些帮助.我创建了一个动态菜单导航栏,显示符合我设置顺序的菜单项.我正在使用这个nestedsortable插件,来订购我的菜单项,但目前我的菜单只有2个级别,所以基本上它是这样的:
Item1
Item2
> Subitem2.1
> Subitem2.2
Item3
etc etc.
Run Code Online (Sandbox Code Playgroud)
我想做的是用n级制作它,所以基本上是这样的:
Item1
Item2
> Subitem2.1
>> Subitem2.1.1
> Subitem2.2
Item3
etc etc.
Run Code Online (Sandbox Code Playgroud)
并且每个项目都可以达到n级深度.问题是,如果我将新订单设置为超过2级深度的菜单项,则会出现错误,订单不会存储在数据库中.我该怎么办呢?
数据库结构是这样的:
table: Menu
id (pk)
menu_item
parent_id // it is the id of the parent menu item
order
Run Code Online (Sandbox Code Playgroud)
这是我的主要(模型)功能:
// save the order of the menu items
public function save_order($items){
if (count($items)>0) {
foreach ($items as $order => $item) {
if ($item['item_id'] != '') {
$data = array(
'parent_id' => (int)$item['parent_id'],
'order' => $order
); …
Run Code Online (Sandbox Code Playgroud) 我需要一些帮助,因为我是 Node.js 和 Express 的新手。我正在 Postman 上测试以下代码
const Joi = require('@hapi/joi');
const bodyParser = require('body-parser');
// Load the express framework
const express = require('express');
const app = express();
app.use(express.json());
app.use(bodyParser.json());
app.use(express.urlencoded({ extended: true }));
// temp array
const courses = [
{id: 1, title: 'Learning Node.js'},
{id: 2, title: 'How to become a full stack dev'},
{id: 3, title: 'Master your Javascript skills'}
];
app.post('/api/courses', (request, response) => {
let error = validateCourse(request.body);
if (error) {
response.status(400).send(error.details[0].message); // *
return; …
Run Code Online (Sandbox Code Playgroud) 我按照Phil的Sturgeon 示例创建了两个控制器,Public_Controller和./application/libraries文件夹中的Admin_Controller .
我想要做的是特定地自动加载Public_Controller和Admin_Controller,所以我在./application/config.php中创建了这个自动加载功能.
function __autoload($class) {
// Autoload only Public_Controller and Admin_Controller
if (strpos($class, 'CI_') !== 0) {
$file = APPPATH . 'libraries/'. $class .'.php';
if ( file_exists($file) && is_file($file) ) {
@include_once($file);
}
}
}
Run Code Online (Sandbox Code Playgroud)
我认为这个问题是我有更多的文件包含在库文件夹中,所以那些也是自动加载的,这不是我想要的.所以我尝试对第一个if语句进行一些小改动,如下所示:
if ( in_array($class, array('Public_Controller, Admin_Controller')) ) // instead of strpos
Run Code Online (Sandbox Code Playgroud)
为了只针对这两个类,但这似乎不起作用.我可能做错了什么想法?
使用单个命令创建文件/目录时可以设置权限吗?还是必须先创建文件/目录,然后使用 chmod 设置其权限?
例如做这样的事情
// for directories
mkdir 755 test
// for files
touch 644 test/my_file.php
Run Code Online (Sandbox Code Playgroud) codeigniter ×3
php ×3
docker ×2
autoload ×1
chmod ×1
command-line ×1
express ×1
forms ×1
git ×1
html ×1
input ×1
javascript ×1
json ×1
laravel ×1
libraries ×1
linux ×1
mysql ×1
navigation ×1
nested ×1
node.js ×1
permissions ×1
postman ×1
request ×1
ubuntu-18.04 ×1