我在MacOSX上使用Docker(使用Boot2Docker).
我可以从Docker Hub运行图像.
但是,当我尝试运行我自己的一个图像时:
docker run -P mylocalimage
Run Code Online (Sandbox Code Playgroud)
要么
docker run -P mylocalimage bin/a3-write-back
Run Code Online (Sandbox Code Playgroud)
要么
...
Run Code Online (Sandbox Code Playgroud)
我明白了:
docker "env: can't execute 'bash': No such file or directory"
Run Code Online (Sandbox Code Playgroud)
我想它找不到要在容器中执行的bash二进制文件,但为什么呢?
基本图像是 errordeveloper/oracle-jdk
谢谢你的帮助.
阿什利.
[{
"Architecture": "amd64",
"Author": "ABC email@email.com",
"Checksum": "tarsum.dev+sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"Comment": "",
"Config": {
"AttachStderr": false,
"AttachStdin": false,
"AttachStdout": false,
"Cmd": [],
"CpuShares": 0,
"Cpuset": "",
"Domainname": "",
"Entrypoint": [
"bin/a3-write-back"
],
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/jdk1.8.0_25/bin",
"JAVA_HOME=/usr/jdk1.8.0_25"
],
"ExposedPorts": null,
"Hostname": "5bf0de3d0926",
"Image": "abd65ce243a5b015bb49f3e958103a5cc0c5f14938df4e480ded25f3ecf878e7",
"MacAddress": "",
"Memory": 0,
"MemorySwap": 0,
"NetworkDisabled": …
Run Code Online (Sandbox Code Playgroud) 我可以判断node.js或io.js是否正在运行的唯一方法是检查process.versions.node
.在io.js中,我得到1.0.4.
我相信有更好的方法 - 有人知道吗?
>InsecurePlatformWarning
Exception:
Traceback (most recent call last):
File "/home/rayra/devstack/devstack/tmp-venv-5XVD/local/lib/python2.7/site-packages/pip/basecommand.py", line 223, in main
status = self.run(options, args)
File "/home/rayra/devstack/devstack/tmp-venv-5XVD/local/lib/python2.7/site-packages/pip/commands/install.py", line 293, in run
wb.build(autobuilding=True)
File "/home/rayra/devstack/devstack/tmp-venv-5XVD/local/lib/python2.7/site-packages/pip/wheel.py", line 705, in build
self.requirement_set.prepare_files(self.finder)
File "/home/rayra/devstack/devstack/tmp-venv-5XVD/local/lib/python2.7/site-packages/pip/req/req_set.py", line 334, in prepare_files
functools.partial(self._prepare_file, finder))
File "/home/rayra/devstack/devstack/tmp-venv-5XVD/local/lib/python2.7/site-packages/pip/req/req_set.py", line 321, in _walk_req_to_install
more_reqs = handler(req_to_install)
File "/home/rayra/devstack/devstack/tmp-venv-5XVD/local/lib/python2.7/site-packages/pip/req/req_set.py", line 461, in _prepare_file
req_to_install.populate_link(finder, self.upgrade)
File "/home/rayra/devstack/devstack/tmp-venv-5XVD/local/lib/python2.7/site-packages/pip/req/req_install.py", line 249, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/home/rayra/devstack/devstack/tmp-venv-5XVD/local/lib/python2.7/site-packages/pip/req/req_install.py", line 261, in link
self._link = self._wheel_cache.cached_wheel(link, self.name)
File "/home/rayra/devstack/devstack/tmp-venv-5XVD/local/lib/python2.7/site-packages/pip/wheel.py", line 63, …
Run Code Online (Sandbox Code Playgroud) 我有以下代码:
fun main(args: Array<String>) {
val urlForCSR: URL = ClassLoader.getSystemClassLoader().getResource("merchant.id")
// also tried ClassLoader.getSystemResource("merchant.id")
...
Run Code Online (Sandbox Code Playgroud)
从intelliJ运行时,以下工作正常并找到资源.但是当使用捆绑的jar运行它时会给出一个NullPointerException
.
/src/main/resources/merchant.id
/src/main/java/Route.kt
以下是Maven配置代码段:
...
<!-- Make this jar executable -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>RouteKt</mainClass> <!-- Class generated (for above main func - named Route.kt) -->
</manifest>
</archive>
</configuration>
</plugin>
<!-- Includes the runtime dependencies -->
<plugin>
<groupId>org.dstovall</groupId>
<artifactId>onejar-maven-plugin</artifactId>
<version>1.4.4</version>
<executions>
<execution>
<goals>
<goal>one-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
Run Code Online (Sandbox Code Playgroud)
有没有其他的战争来获取上述资源的URL,这可以使用一个jar或其他方式制作一个胖罐.
Jar内容:
jar tf target/Route-1.0-SNAPSHOT.jar
META-INF/
META-INF/MANIFEST.MF
merchant.id
RouteKt$main$1.class …
Run Code Online (Sandbox Code Playgroud)