小编has*_*chi的帖子

如何用gradle和gpg2签名

gradle签名插件需要secring.gpg密钥环文件,根据文档:https://docs.gradle.org/current/userguide/signing_plugin.html

但是自从gpg 2.1版开始,secring.gpg就不存在了. https://www.gnupg.org/faq/whats-new-in-2.1.html

是否有可能使用gpg> = 2.1的gradle签名插件?

gnupg gradle

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

在Groovy MarkupBuilder中使用命名空间

我想要以下输出:

<?xml version="1.0" encoding="UTF-8"?>
<structure:structuralDataRoot xmlns:register="http://www.test.ch/register/1" xmlns:structure="http://test.ch/structure/1" >
  <structure:tester>ZH</structure:tester>
  <structure:surveyYear>2001</structure:surveyYear>
  <structure:surfaceData>
    <structure:houseSurfaceData>
      <structure:creationDate>2001-01-01</structure:creationDate>
      <structure:localFarmId>
        <register:houseIdCategory>token</register:houseIdCategory>
        <register:houseId>token</register:houseId>
      </structure:localFarmId>
    </structure:houseSurfaceData>
  </structure>
Run Code Online (Sandbox Code Playgroud)

我可以将命名空间添加到xml中,如下所示:

xml.records('xmlns:structure' :"http://test.ch/structure/1" ...
Run Code Online (Sandbox Code Playgroud)

但是我如何为xml元素创建名称空间前缀?我找到的唯一解决方案是:

tester('xmlns:structure' :"http://test.ch/structure/1", 'ZH')
Run Code Online (Sandbox Code Playgroud)

但这给了我以下输出:

<tester xmlns:structure='http://test.ch/structure/1'>ZH</tester>
Run Code Online (Sandbox Code Playgroud)

它的语法是正确的,但是当你有很多节点时阅读并不好.

groovy namespaces markupbuilder

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

使用 docker-compose 挂载 root FS 只读

我尝试应用docker CIS(https://github.com/docker/docker-bench-security

测试 5.13 是:Mount container's root filesystem as read only
docker run 有一个选项可以以只读方式挂载 root FS:--read-only=true
但我找不到使用 docker-compose 实现相同目的的可能性。

是否可以使用 docker-compose 以只读方式挂载根 FS?

security docker docker-compose

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