小编Cam*_*lva的帖子

Docker守护程序标志被忽略

环境:

  • 操作系统:debian 8.0.0-amd64,ubuntu-15.04,16.04
  • Docker:1.xx

程序:

我改为/etc/default/docker添加私有docker注册表,然后我重新启动了docker服务,最后尝试拉一些图像.

$ cat /etc/default/docker
DOCKER_OPTS="--insecure-registry mydocker-registry.net:5000"

$ service docker restart

$ docker pull mydocker-registry.net:5000/testdb
FATA[0000] Error: v1 ping attempt failed with error: Get https://mydocker-
registry.net:5000/v1/_ping: dial tcp: lookup mydocker-registry.net: no 
such host. If this private registry supports only HTTP or HTTPS with an 
unknown CA certificate, please add `--insecure-registry mydocker-
registry.net:5000` to the daemon's arguments. In the case of HTTPS, if 
you have access to the registry's CA certificate, no need …
Run Code Online (Sandbox Code Playgroud)

ubuntu debian docker

21
推荐指数
3
解决办法
1万
查看次数

标准渴望fetch-joined集合以避免n + 1选择

假设Item和Bid是实体:Item有很多Bids.它们以典型的父/子关系映射到Hibernate中:

<class name="Item" table="ITEM">
  ...
  <set name="bids" inverse="true">
    <key column="ITEM_ID"/>
    <one-to-many class="Bid"/>
  </set>
</class>
Run Code Online (Sandbox Code Playgroud)

在执行此查询后尝试访问每个项目的出价时,如何避免n + 1选择?

List<Item> items = session.createCriteria(Item.class)
                        .createAlias("bids", "b").
                        .add(Restrictions.gt("b.amount", 100)).
                        .list();
Run Code Online (Sandbox Code Playgroud)

注意我需要一个热切的提取出价,但对集合有进一步的限制(b.amount> 100)

我尝试了下面的失败:

List<Item> items = session.createCriteria(Item.class)
                        .setFetchMode("bids", FetchMode.JOIN).
                        .createAlias("bids", "b").
                        .add(Restrictions.gt("b.amount", 100)).
                        .list();                        

List<Item> items = session.createCriteria(Item.class)
                        .createCriteria("bids")
                        .add(Restrictions.gt("amount", 100)).
                        .list();                        
Run Code Online (Sandbox Code Playgroud)

java hibernate hibernate-criteria

12
推荐指数
2
解决办法
3万
查看次数

mongod --bind_ip使用docker-compose版本2

我正在尝试连接在docker上运行的两个mongodb容器docker-compose.一个容器将一些数据播种到另一个容器中mongoimport.

但是,我在运行时遇到以下错误 mongoimport

Failed: error connecting to db server: no reachable servers
Run Code Online (Sandbox Code Playgroud)

其实我可以达到mongodb从容器mongo-seed,因为我会追加一ping -c 3 mongodbCMD和容器可以成功解析该主机名.

在我正在使用的文件下面:

泊坞窗,compose.yml

version: '2'

services:
  mongodb:
    image: mongo:3.2
    ports:
      - "27017:27017"

  mongo-seed:
    build: ./mongo-seed
Run Code Online (Sandbox Code Playgroud)

蒙戈种子/ Dockerfile

FROM mongo:3.2

COPY init.json /init.json
CMD ping -c 3 mongodb && mongoimport --host mongodb --db test --collection users \
   --type json --file /init.json --jsonArray
Run Code Online (Sandbox Code Playgroud)

蒙戈种子/ init.json

[
  {
    "name": "Joe Smith",
    "email": "jsmith@gmail.com",
    "age": 40,
    "admin": …
Run Code Online (Sandbox Code Playgroud)

mongodb docker docker-compose

7
推荐指数
1
解决办法
8118
查看次数

Wildfly SSL协议(TLSv1.2)配置

我想知道在wildfly上配置SSL协议的正确方法.

在查看示例时,我发现了两种不同的方法.我想知道哪一个是正确的做法 -

将其添加到协议部分,如下所示:

<security-realm name="sslRealm">
            <server-identities>
                 <ssl protocol="TLSv1.2">
Run Code Online (Sandbox Code Playgroud)

或者在https监听器中添加它,如下所示:

<https-listener name="https" socket-binding="https" security-
realm="sslRealm" enabled-protocols="TLSv1.2"/>
Run Code Online (Sandbox Code Playgroud)

我正在使用wildfly-8.2.0.Final.

ssl wildfly wildfly-8 tls1.2

6
推荐指数
1
解决办法
4498
查看次数

Ubuntu 中不支持 SQLCipher 的 SQLite 浏览器

默认情况下,用于 ubuntu 的 SQLite 浏览器包不附带 SQLCipher。

sudo add-apt-repository -y ppa:linuxgndu/sqlitebrowser
sudo apt-get update
sudo apt-get install sqlitebrowser
Run Code Online (Sandbox Code Playgroud)

问题

如何启用它才能查看加密的数据库?

什么版本

  • Ubuntu 17.10
  • SQLite 浏览器 3.10.99
  • Qt 5.9.1
  • SQLite 3.19.3

sqlite ubuntu sqlcipher sqlite-browser

6
推荐指数
1
解决办法
854
查看次数

尝试编译 haskell 代码时出现链接错误

Linking 1 ...
/usr/bin/ld.gold: error: cannot find -lgmp
/home/sam/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/integer-gmp-1.0.3.0/libHSinteger-gmp-1.0.3.0.a(Type.o):ghc_4.c:function integerzmwiredzmin_GHCziIntegerziType_zdwplusBigNatWord_info: error: undefined reference to '__gmpn_add_1'
/home/sam/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/integer-gmp-1.0.3.0/libHSinteger-gmp-1.0.3.0.a(Type.o):ghc_4.c:function integerzmwiredzmin_GHCziIntegerziType_zdwminusBigNatWord_info: error: undefined reference to '__gmpn_sub_1'
/home/sam/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/integer-gmp-1.0.3.0/libHSinteger-gmp-1.0.3.0.a(Type.o):ghc_4.c:function integerzmwiredzmin_GHCziIntegerziType_zdwtimesBigNatWord_info: error: undefined reference to '__gmpn_mul_1'
/home/sam/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/integer-gmp-1.0.3.0/libHSinteger-gmp-1.0.3.0.a(Type.o):ghc_4.c:function integerzmwiredzmin_GHCziIntegerziType_zdwgo_info: error: undefined reference to '__gmpn_add'
/home/sam/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/integer-gmp-1.0.3.0/libHSinteger-gmp-1.0.3.0.a(Type.o):ghc_4.c:function integerzmwiredzmin_GHCziIntegerziType_zdwminusBigNat_info: error: undefined reference to '__gmpn_sub'
/home/sam/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/integer-gmp-1.0.3.0/libHSinteger-gmp-1.0.3.0.a(Type.o):ghc_4.c:function integerzmwiredzmin_GHCziIntegerziType_zdwtimesBigNat_info: error: undefined reference to '__gmpn_mul'
/home/sam/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/integer-gmp-1.0.3.0/libHSinteger-gmp-1.0.3.0.a(Type.o):ghc_4.c:function integerzmwiredzmin_GHCziIntegerziType_plusInteger_info: error: undefined reference to '__gmpn_cmp'
/home/sam/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/integer-gmp-1.0.3.0/libHSinteger-gmp-1.0.3.0.a(Type.o):ghc_4.c:function integerzmwiredzmin_GHCziIntegerziType_leIntegerzh_info: error: undefined reference to '__gmpn_cmp'
/home/sam/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/integer-gmp-1.0.3.0/libHSinteger-gmp-1.0.3.0.a(Type.o):ghc_4.c:function integerzmwiredzmin_GHCziIntegerziType_leIntegerzh_info: error: undefined reference to '__gmpn_cmp'
collect2: error: ld returned 1 exit status
`gcc' failed …
Run Code Online (Sandbox Code Playgroud)

haskell compiler-errors

1
推荐指数
1
解决办法
1124
查看次数