小编use*_*mda的帖子

从远程仓库删除 docker 镜像

我有以下内容

泊坞窗注册表:http://myPrivateRegistry:5000

存储库:myRepo

图片:我的图片

我通过以下方式将此图像推送到远程存储库

docker push http://myPrivateRegistry:5000/myRepo/myImage
Run Code Online (Sandbox Code Playgroud)

如何从“远程存储库”中删除该图像而不仅仅是在本地? docker rmi http://myPrivateRegistry:5000/myRepo/myImage取消图像的标签,但不会将其从远程存储库中删除

image remote-server docker

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

createTimestamp:对于 Kubernetes 复制控制器模板为 null

creationTimestamp当模板的 为 时,这意味着什么null

"template": {
          "metadata": {
            "creationTimestamp": null,
            "labels": {
              "name": "kube-template"
            }
          },
Run Code Online (Sandbox Code Playgroud)

scheduling docker kubernetes

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

匿名拉神器中的码头回购

我在artifactory版本4.6上,并在docker注册表上有以下要求.

允许匿名提取docker repository强制身份验证SAME docker存储库

我知道这可以在更高版本的神器中开箱即用.然而升级对我们来说暂时不是一个选择.

以下是否可以解决问题?

  1. 在端口8443上创建虚拟docker存储库并且不强制进行身份验证,将其称为docker-virtual
  2. 创建本地docker存储库并强制进行身份验证,在端口8444上将其命名为docker-local
  3. 将"docker-virtual"配置为默认部署目录为"docker-local"

    docker pull docker-virtual should work docker push docker-virtual should ask for credentials

失败后,我应该能够停靠login docker-virtualdocker push docker-virtual/myImage

authentication artifactory docker

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

不存在像默认构造那样的创建者):无法从[来源:(字符串)处的对象值(没有基于委托或属性的创建者)反序列化

我有一个具有以下三个构造函数的实体

public MyObject() {
   // Default constructor to avoid ambiguity
  }


    public MyObject(String arg1, String arg2, String arg3) {

        AnotherType anothertype = new AnotherType(arg1, arg2, arg3);
        this.anotherTpe = anotherTpe;
      }

      public MyObject(AnotherType anotherType) {

        this.anotherType = anotherType;
      }
Run Code Online (Sandbox Code Playgroud)

然后我编写一个测试来检查反序列化的流程

@Test public void serializesToJSON() 抛出异常 {

final MyObject myObject =
    new MyObject(new AnotherType("arg1", "ar2", "arg3"));

ObjectMapper mapper = new ObjectMapper();
assertThat(MAPPER.readValue(fixture("fixtures/myObject.json"), MyObject.class))
    .isEqualTo(myobject);
Run Code Online (Sandbox Code Playgroud)

}

此操作失败并出现错误

cannot construct instance of `AnotherType` (no Creators, like default construct, exist): cannot deserialize from Object value …
Run Code Online (Sandbox Code Playgroud)

constructor jackson deserialization dropwizard

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

“docker pull”命令的协议

我不确定“docker pull”或“docker push”命令使用什么协议。当我尝试使用以下约定从远程存储库访问图像时

"docker pull http://my-repo/image-name:tag"
Run Code Online (Sandbox Code Playgroud)

它失败了

 http://my-repo/image-name:tag is not a valid repository/tag
Run Code Online (Sandbox Code Playgroud)

但以下命令运行没有问题

"docker pull my-repo/image-name:tag"
Run Code Online (Sandbox Code Playgroud)

我有一个要求,我需要"http://"存储库名称中的前缀。如何才能实现这一目标?

image http docker

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

Liquibase - 如何跳过已执行的变更集

我有一个由 mysql 数据库支持的 dropwizard 应用程序。我正在使用 liquibase 包装器进行数据库迁移

首先,我使用“db dump”命令自动生成migrations.xml 文件。

现在我正在重构数据库,我希望能够更新特定的列名和表名。

我使用先决条件跳过已经生成的表来跳过 ' createTable' 命令

<preConditions onFail="MARK_RAN">
            <not>
                <tableExists tableName="myTable" />
            </not>
        </preConditions>
Run Code Online (Sandbox Code Playgroud)

现在如何跳过主键和外键约束的执行?变更日志级别是否有一个前提条件,我可以用它来指示“跳过已执行的变更集”?或者我只是创建一个新的migrations.xml?这会删除现有数据吗?

refactoring liquibase sql-update dropwizard

4
推荐指数
1
解决办法
2万
查看次数

boto3 列出组织中的所有帐户

我有一个要求,我想列出所有帐户,然后将所有凭据写入我的~/.aws/credentials文件中。为此,我boto3按以下方式使用

import boto3

client = boto3.client('organizations')
response = client.list_accounts(
    NextToken='string',
    MaxResults=123
)
print(response)
Run Code Online (Sandbox Code Playgroud)

此操作失败并出现以下错误

botocore.exceptions.ClientError: An error occurred (ExpiredTokenException) when calling the ListAccounts operation: The security token included in the request is expired
Run Code Online (Sandbox Code Playgroud)

问题是,它正在查看哪个令牌?如果我想要有关所有帐户的信息,我应该在credentials文件或config文件中使用什么凭据?

token boto3 aws-organizations

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

用Java创建Kubernetes服务

我正在使用fabric8.io在Kubernetes中编排应用程序容器.我正在寻找创建一个服务来管理某个端口上具有特定标签的pod.是否有API的特定示例执行此操作.我在例子中找不到它

https://github.com/fabric8io/kubernetes-client/blob/master/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/FullExample.java#L75

似乎没有javadoc可用???

java service fabric8 kubernetes

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

使用调用程序插件运行单个测试

以下是我的集成测试的目录结构

 /src/it/first-test  
           -->my-test  
               -->build.log
               -->inoker.properties
               -->pom.xml
               -->verify.groovy
Run Code Online (Sandbox Code Playgroud)

当我尝试按照https://maven.apache.org/plugins/maven-invoker-plugin/usage.html所述运行单个集成测试时。它给出了一条消息“没有选择执行项目”这是我用来调用项目的命令

/src/main> mvn invoker:run -Dinvoker.test=first-test/my-test*
Run Code Online (Sandbox Code Playgroud)

我应该如何确保测试运行?

integration-testing maven maven-invoker-plugin

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

使用mockito模拟HttpClient请求

我希望使用 Junit 和 Mockito 测试以下代码。

要测试的代码:

    Header header = new BasicHeader(HttpHeaders.AUTHORIZATION,AUTH_PREAMBLE + token);
    List<Header> headers = new ArrayList<Header>();
    headers.add(header);
    HttpClient client = HttpClients.custom().setDefaultHeaders(headers).build();
    HttpGet get = new HttpGet("real REST API here"));
    HttpResponse response = client.execute(get);
    String json_string_response = EntityUtils.toString(response.getEntity());
Run Code Online (Sandbox Code Playgroud)

和测试

protected static HttpClient mockHttpClient;
protected static HttpGet mockHttpGet;
protected static HttpResponse mockHttpResponse;
protected static StatusLine mockStatusLine;
protected static HttpEntity mockHttpEntity;





@BeforeClass
public static void setup() throws ClientProtocolException, IOException {
    mockHttpGet = Mockito.mock(HttpGet.class);
    mockHttpClient = Mockito.mock(HttpClient.class);
    mockHttpResponse = Mockito.mock(HttpResponse.class);
    mockStatusLine = …
Run Code Online (Sandbox Code Playgroud)

junit unit-testing httpclient mockito unknown-host

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