在mac osx上新的docker.我正在从基本的phusion图像构建一个ubuntu图像,以用作git服务器.使用以下文件安装基础和所需的软件.这非常有效.但是,我无法ping通机器.
编辑
我无法ping通机器.我可以运行图像并在ps命令中查看容器.我也可以抨击它.
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
54e4cef78445 git-ssh_img "/usr/sbin/sshd -D" 44 minutes ago Up 44 minutes 22/tcp git-ssh
Run Code Online (Sandbox Code Playgroud)
以下也有效
docker exec -it 54e4cef78445 ping www.google.com
PING www.google.com (173.194.219.147) 56(84) bytes of data.
64 bytes from ya-in-f147.1e100.net (173.194.219.147): icmp_seq=1 ttl=61 time=65.1 ms
64 bytes from ya-in-f147.1e100.net (173.194.219.147): icmp_seq=2 ttl=61 time=67.1 ms
Run Code Online (Sandbox Code Playgroud)
Dockerfile:
# Use phusion/baseimage as base image. To make your builds reproducible, make
# sure you lock down to a specific version, not to …Run Code Online (Sandbox Code Playgroud) 我在roboelectric 2.2中遇到以下错误
java.lang.IncompatibleClassChangeError: class org.objectweb.asm.tree.ClassNode has interface org.objectweb.asm.ClassVisitor as super class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at org.robolectric.RobolectricTestRunner.createRobolectricClassLoader(RobolectricTestRunner.java:144)
at org.robolectric.RobolectricTestRunner.createSdkEnvironment(RobolectricTestRunner.java:116)
at org.robolectric.RobolectricTestRunner$3.create(RobolectricTestRunner.java:279)
at org.robolectric.EnvHolder.getSdkEnvironment(EnvHolder.java:21)
at org.robolectric.RobolectricTestRunner.getEnvironment(RobolectricTestRunner.java:277)
at org.robolectric.RobolectricTestRunner.access$100(RobolectricTestRunner.java:57)
at org.robolectric.RobolectricTestRunner$2.evaluate(RobolectricTestRunner.java:188)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.robolectric.RobolectricTestRunner$1.evaluate(RobolectricTestRunner.java:175)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at …Run Code Online (Sandbox Code Playgroud) 在css中,margin-left的默认值为0。我知道,因为它是0,所以不需要任何单位。无论是em还是px,都没有关系。但我继承了公司的代码,其中规定:
左边距:10;
我猜这意味着默认情况下 10px ?我想我可以尝试 em 和 px 看看哪个看起来更好。
我正在使用XCtest来测试视图的标题.试着养成先写测试的习惯.设置看起来像
- (void)setUp
{
[super setUp];
self.appDelegate = [[UIApplication sharedApplication] delegate];
self.tipViewController = self.appDelegate.tipViewController;
self.tipView = self.tipViewController.view;
self.settingsViewController = self.appDelegate.settingsViewController;
self.settingsView = self.settingsViewController.view;
}
Run Code Online (Sandbox Code Playgroud)
问题是"settingsViewController".我有两个实际测试功能:
- (void) testTitleOfMainView{
XCTAssertTrue([self.tipViewController.title isEqualToString:@"Tip Calculator"], @"The title should be Tip Calculator");
//why does this not work?
// XCTAssertEqual(self.tipViewController.title, @"Tip Calculator", @"The title should be Tip Calculator");
}
- (void) testTitleOfSettingsView{
//make the setttings view visible
[self.tipViewController onSettingsButton];
//test the title
XCTAssertTrue([self.settingsViewController.title isEqualToString:@"Settings"], @"The title should be Settings");
}
Run Code Online (Sandbox Code Playgroud)
"testTitleOfMainView"有效.但是"testTitleOfSettingsView失败,因为self.settingsViewController是nil.我可以理解为什么.视图还没有初始化.所以我尝试将消息发送到主控制器,使settignscontroller在视图中
[self.tipViewController onSettingsButton];
Run Code Online (Sandbox Code Playgroud)
settingsController仍为零.我应该使用嘲笑吗?有人建议我用另一个问题 xctest - …