我改为/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) 假设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) 我正在尝试连接在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 mongodb到CMD和容器可以成功解析该主机名.
在我正在使用的文件下面:
泊坞窗,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) 我想知道在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.
默认情况下,用于 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)
如何启用它才能查看加密的数据库?
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)