forked from docker-java/docker-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTagImageCmdIT.java
More file actions
29 lines (20 loc) · 944 Bytes
/
Copy pathTagImageCmdIT.java
File metadata and controls
29 lines (20 loc) · 944 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package com.github.dockerjava.cmd;
import com.github.dockerjava.api.exception.NotFoundException;
import org.apache.commons.lang3.RandomUtils;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class TagImageCmdIT extends CmdIT {
public static final Logger LOG = LoggerFactory.getLogger(TagImageCmdIT.class);
@Test
public void tagImage() throws Exception {
String tag = "" + RandomUtils.nextInt(0, Integer.MAX_VALUE);
dockerRule.getClient().tagImageCmd("busybox:latest", "docker-java/busybox", tag).exec();
dockerRule.getClient().removeImageCmd("docker-java/busybox:" + tag).exec();
}
@Test(expected = NotFoundException.class)
public void tagNonExistingImage() throws Exception {
String tag = "" + RandomUtils.nextInt(0, Integer.MAX_VALUE);
dockerRule.getClient().tagImageCmd("non-existing", "docker-java/busybox", tag).exec();
}
}