我可以列出所有容器docker ps (-a),我可以列出所有卷docker volumes ls,当我检查一下时volume,我可以看到name,driver而且mountpoint,而不是它正在使用的容器.
当我使用时docker inspect <container>,我可以看到像这样的Mount数据,例如:
"Mounts": [
{
"Name": "centos_db_symfony",
"Source": "/var/lib/docker/volumes/centos_db_symfony/_data",
"Destination": "/var/lib/mysql",
"Driver": "local",
"Mode": "rw",
"RW": true,
"Propagation": "rprivate"
},
Run Code Online (Sandbox Code Playgroud)
所以从理论上讲,我可以编写一个循环遍历所有容器的脚本来匹配特定volume的名称.但是我运行了一些容器docker-compose,并没有将某个名称(就像现在可能在v2中)绑定到某些卷,因此它们在docker volume ls列表中显示为sha256 ,如下所示:
DRIVER VOLUME NAME
local 34009871ded5936bae81197247746b708c3ec9e9b9832b702c09736a90...etc
local centos_data
local centos_db_symfony
Run Code Online (Sandbox Code Playgroud)
在这种情况下34009871ded5(示例)是在我之前docker-compose和centos_db_symfony之后命名卷之前创建的.
当docker-compose.yml更新卷信息时,就像在这种情况下更新命名卷和信息一样,docker inspect <container>历史记录是否永远丢失,或者我可以找出卷使用哪个容器?如果是这样,是否还可以恢复这样的旧卷?
docker-compose version 1.6.0, build d99cad6 …Run Code Online (Sandbox Code Playgroud) I am trying to build a coupon site in Laravel. Each merchant has their own deals/coupons. I have been able to print deals/coupons for a merchant on their specific pages.
Here's my query
$deals = DB::table('deals')
-> join ('merchants', 'deals.merchant_id', '=', 'merchants.merchant_id')
-> where ('merchant_url_text', $merchant_url_text)
-> get();
Run Code Online (Sandbox Code Playgroud)
So far so good.
Now this is where it starts getting complex.
Each deal has 2 more pieces associated with it. Click counts and Votes associated with deals.
The click counts are …
每当我试图使用\Auth::User()我得到非对象属性,因为Auth::guest()无论何时我在服务提供商中使用它都返回true
use Illuminate\Contracts\View\View;
use Illuminate\Support\ServiceProvider;
use Illuminate\Contracts\View\Factory;
use App\relations;
use App\User;
use DB;
use Illuminate\Support\Facades\Auth;
class RelationServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
//
\Auth::User()->id;
$relation_friend_for_logged_user = DB::select( DB::raw("SELECT * FROM users"));
$value = "asd";
// for injecting objct
View()->share('count', $value);
}
Run Code Online (Sandbox Code Playgroud)
但是,\Auth::guest()无论我是否登录,为什么返回true