I'm using a following docker-compose file in a java web app project.
version: "3"
services:
product:
image: jboss/wildfly
ports:
- 8080:8080
volumes:
- Product/target/Product.war:/opt/jboss/wildfly/standalone/deployments
The error I'm getting is
ERROR: Named volume "Product/target/Product.war:/opt/jboss/wildfly/standalone/deployments:rw" is used in service "product" but no declaration was found in the volumes section.
Failed to deploy 'Compose: docker-compose.yml': `docker-compose` process finished with exit code 1
Edit OCI runtime create failed:
Following the fix of the path, I'm encountering another error. OCI runtime create failed:
Deploying 'Compose: docker-compose.yml'...
/usr/local/bin/docker-compose -f /Users/username/Desktop/Project/docker-compose.yml up -d
Starting project_product ...
Starting project_product ... error
ERROR: for project_product Cannot start service product: OCI runtime create failed: container_linux.go:344: starting container process caused "process_linux.go:424: container init caused \"rootfs_linux.go:58: mounting \\\"/Users/username/Desktop/Project/User/target/Product.war\\\" to rootfs \\\"/var/lib/docker/overlay2/e090197e0697ec14446020cf2444dc0d3f39dfb240de9f399017415f6faeb13b/merged\\\" at \\\"/var/lib/docker/overlay2/e090197e0697ec14446020cf2444dc0d3f39dfb240de9f399017415f6faeb13b/merged/opt/jboss/wildfly/standalone/deployments\\\" caused \\\"not a directory\\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
ERROR: for product Cannot start service product: OCI runtime create failed: container_linux.go:344: starting container process caused "process_linux.go:424: container init caused \"rootfs_linux.go:58: mounting \\\"/Users/username/Desktop/Project/User/target/Product.war\\\" to rootfs \\\"/var/lib/docker/overlay2/e090197e0697ec14446020cf2444dc0d3f39dfb240de9f399017415f6faeb13b/merged\\\" at \\\"/var/lib/docker/overlay2/e090197e0697ec14446020cf2444dc0d3f39dfb240de9f399017415f6faeb13b/merged/opt/jboss/wildfly/standalone/deployments\\\" caused \\\"not a directory\\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
ERROR: Encountered errors while bringing up the project.
Failed to deploy 'Compose: docker-compose.yml': `docker-compose` process finished with exit code 1
You must add . at the beginning or use an absolute path when mounting a local file into a container. Otherwise Docker will assume it's a named volume, as the error suggests.
Related
I am trying to pass JVM args to Docker image of Spring boot app on Kubernetes. Specifically, I wanted to pass these three arguments:
-Djavax.net.ssl.trustStore=/certs/truststore/cacerts
-Djavax.net.ssl.trustStorePassword=password
-Djavax.net.debug=ssl
I tried adding it to "env" section with name as "JAVA_OPTS", "JDK_JAVA_OPTIONS" and "JAVA_TOOL_OPTIONS", none of which seemed like they were working.
I also tried adding it under "args" section, that did not work either. At best I get no change in behaviour at all, at worst my pods won't start at all with this error:
Error: failed to create containerd task: OCI runtime create failed:
container_linux.go:380: starting container process caused:
process_linux.go:545: container init caused: setenv: invalid argument:
unknown
Entry point in Dockerfile is defined as such:
ENTRYPOINT ["java","-jar","/app/appname-exec.jar"]
Any ideas?
To override the container's default ENTRYPOINT setting, I sometimes do the following:
containers:
- name: my-container
image: mycontainer:latest
command: ["java"]
args: ["-Djavax...", "-Djavax...", "-jar", "myapp.jar"]
You can define content in the manifest that you would describe in a Dockerfile. In args section, you can describe as many settings as you want.
Enviornment - solr-8.9.0, java version "11.0.12" 2021-07-20 LTS, apache-zookeeper-3.6.1-bin/
To set-up solrCloud i have done following steps-
Setting-up Zookeeper on Node 1
a. Go inside <ZK_HOME>/conf directory.
b. Make a copy of zoo_sample.cfg & rename to zoo.cfg (or mv zoo_sample.cfg to zoo.cfg)
c. Edit zoo.cfg and modify data_dir parameter to a directory location where you would like Zookeeper to store its data.
dataDir=<ZK_HOME>/conf/data
d. Now start Zookeeper with command
./bin/zkServer.sh start
Solr Setup on Node 1 / Machine 1
a. Create directory solr-8.9.0/server/solr/node1/solr/.
b. Copy default zoo.cfg & solr.xml from solr-8.9.0/server/solr to solr5.x.x/server/solr/node1/solr/
c. Now lets start Solr using below command (basically you want to start in cloud mode with Zookeeper)
./bin/solr start -cloud -s solr-8.9.0/server/solr/node1/solr -p 8983 -z <Node1 IP>:2181 -m 2g
Solr Setup on Node 2 / Machine 2
a. Create directory solr-8.9.0/server/solr/node1/solr/.
b. Copy default zoo.cfg & solr.xml from solr-8.9.0/server/solr to solr5.x.x/server/solr/node1/solr/
c. ./solr start -cloud -s solr-8.9.0/server/solr/node1/solr -p 8983 -z <Node1 IP>:2181 -m 2g
Upload configs to Zookeeper
a. ./server/scripts/cloud-scripts/zkcli.sh -zkhost <Node1 IP>:2181 -cmd upconfig -confname _defaults -confdir solr-8.9.0/server/solr/configsets/_defaults/conf
Creating a collection
http://<Node1 IP>:8983/solr/admin/collections?action=CREATE&name=<myCollection>&numShards=2&replicationFactor=2&maxShardsPerNode=2&collection.configName=_defaults
But i am getting following error while creation of collection
{
"responseHeader":{
"status":400,
"QTime":1213},
"failure":{
"$Node2:8983_solr":"org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:Error from server at http://$Node2:8983/solr: Path /home/solr/solr-8.9.0/server/solr/node1/solr/myCollection_shard1_replica_n2 must be relative to SOLR_HOME, SOLR_DATA_HOME coreRootDirectory. Set system property 'solr.allowPaths' to add other allowed paths.",
"$Node2:8983_solr":"org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:Error from server at http://$Node2:8983/solr: Path /home/solr/solr-8.9.0/server/solr/node1/solr/myCollection_shard2_replica_n6 must be relative to SOLR_HOME, SOLR_DATA_HOME coreRootDirectory. Set system property 'solr.allowPaths' to add other allowed paths.",
"127.0.1.1:8983_solr":"org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:Error from server at http://127.0.1.1:8983/solr: Path /data/Lucene/solr/solrcloud/solr-8.9.0/server/solr/node1/solr/myCollection_shard2_replica_n4 must be relative to SOLR_HOME, SOLR_DATA_HOME coreRootDirectory. Set system property 'solr.allowPaths' to add other allowed paths.",
"127.0.1.1:8983_solr":"org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:Error from server at http://127.0.1.1:8983/solr: Path /data/Lucene/solr/solrcloud/solr-8.9.0/server/solr/node1/solr/myCollection_shard1_replica_n1 must be relative to SOLR_HOME, SOLR_DATA_HOME coreRootDirectory. Set system property 'solr.allowPaths' to add other allowed paths."},
"Operation create caused exception:":"org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Underlying core creation failed while creating collection: myCollection",
"exception":{
"msg":"Underlying core creation failed while creating collection: myCollection",
"rspCode":400},
"error":{
"metadata":[
"error-class","org.apache.solr.common.SolrException",
"root-error-class","org.apache.solr.common.SolrException"],
"msg":"Underlying core creation failed while creating collection: myCollection",
"code":400}}
Why above error was occurred? What steps i am missing while setting up solrCloud on 2 machines with 1 zookeeper instance? Could someone help me find the missing piece?
As error suggest
Use absolute path while starting the solr instance on both nodes.
Use abosolute path for 'confdir' parameter while uploading configuration to zookeeper.
I'm working on an open-source project called "Cloudnet-v3". I am using a symlink /data on my local machine to the data-point in my IntelliJProjects-Folder.
I got the following startup command:
[java, -XX:+UseG1GC, -XX:MaxGCPauseMillis=50, -XX:-UseAdaptiveSizePolicy, -XX:CompileThreshold=100, -XX:+UnlockExperimentalVMOptions, -XX:+UseCompressedOops, -Dcom.mojang.eula.agree=true, -Djline.terminal=jline.UnsupportedTerminal, -Dfile.encoding=UTF-8, -Dio.netty.noPreferDirect=true, -Dclient.encoding.override=UTF-8, -Dio.netty.maxDirectMemory=0, -Dio.netty.leakDetectionLevel=DISABLED, -Dio.netty.recycler.maxCapacity=0, -Dio.netty.recycler.maxCapacity.default=0, -DIReallyKnowWhatIAmDoingISwear=true, -Dcloudnet.wrapper.receivedMessages.language=english, -Xmx372M, -javaagent: "/data/temp/caches/wrapper.jar", -cp, "/data/launcher/libs/io/kubernetes/client-java/4.0.0/client-java-4.0.0.jar:/data/launcher/libs/io/netty/netty-codec-http/4.1.36.Final/netty-codec-http-4.1.36.Final.jar:/data/launcher/libs/io/netty/netty-handler/4.1.36.Final/netty-handler-4.1.36.Final.jar:/data/launcher/libs/io/netty/netty-transport-native-epoll/4.1.36.Final/netty-transport-native-epoll-4.1.36.Final-linux-x86_64.jar:/data/launcher/libs/io/netty/netty-transport-native-kqueue/4.1.36.Final/netty-transport-native-kqueue-4.1.36.Final-osx-x86_64.jar:/data/launcher/libs/io/kubernetes/client-java-api/4.0.0/client-java-api-4.0.0.jar:/data/launcher/libs/io/kubernetes/client-java-proto/4.0.0/client-java-proto-4.0.0.jar:/data/launcher/libs/org/yaml/snakeyaml/1.19/snakeyaml-1.19.jar:/data/launcher/libs/commons-codec/commons-codec/1.11/commons-codec-1.11.jar:/data/launcher/libs/org/apache/commons/commons-compress/1.18/commons-compress-1.18.jar:/data/launcher/libs/org/apache/commons/commons-lang3/3.7/commons-lang3-3.7.jar:/data/launcher/libs/com/squareup/okhttp/okhttp-ws/2.7.5/okhttp-ws-2.7.5.jar:/data/launcher/libs/com/google/guava/guava/25.1-jre/guava-25.1-jre.jar:/data/launcher/libs/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar:/data/launcher/libs/org/bouncycastle/bcprov-ext-jdk15on/1.59/bcprov-ext-jdk15on-1.59.jar:/data/launcher/libs/org/bouncycastle/bcpkix-jdk15on/1.59/bcpkix-jdk15on-1.59.jar:/data/launcher/libs/com/google/protobuf/protobuf-java/3.4.0/protobuf-java-3.4.0.jar:/data/launcher/libs/com/google/code/gson/gson/2.8.2/gson-2.8.2.jar:/data/launcher/libs/io/netty/netty-codec/4.1.36.Final/netty-codec-4.1.36.Final.jar:/data/launcher/libs/io/netty/netty-transport-native-unix-common/4.1.36.Final/netty-transport-native-unix-common-4.1.36.Final.jar:/data/launcher/libs/io/netty/netty-transport/4.1.36.Final/netty-transport-4.1.36.Final.jar:/data/launcher/libs/io/netty/netty-buffer/4.1.36.Final/netty-buffer-4.1.36.Final.jar:/data/launcher/libs/io/netty/netty-resolver/4.1.36.Final/netty-resolver-4.1.36.Final.jar:/data/launcher/libs/io/netty/netty-common/4.1.36.Final/netty-common-4.1.36.Final.jar:/data/launcher/libs/io/sundr/builder-annotations/0.9.2/builder-annotations-0.9.2.jar:/data/launcher/libs/io/swagger/swagger-annotations/1.5.12/swagger-annotations-1.5.12.jar:/data/launcher/libs/com/squareup/okhttp/logging-interceptor/2.7.5/logging-interceptor-2.7.5.jar:/data/launcher/libs/com/squareup/okhttp/okhttp/2.7.5/okhttp-2.7.5.jar:/data/launcher/libs/joda-time/joda-time/2.9.3/joda-time-2.9.3.jar:/data/launcher/libs/org/joda/joda-convert/1.2/joda-convert-1.2.jar:/data/launcher/libs/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar:/data/launcher/libs/org/checkerframework/checker-qual/2.0.0/checker-qual-2.0.0.jar:/data/launcher/libs/com/google/errorprone/error_prone_annotations/2.1.3/error_prone_annotations-2.1.3.jar:/data/launcher/libs/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar:/data/launcher/libs/org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.jar:/data/launcher/libs/org/bouncycastle/bcprov-jdk15on/1.59/bcprov-jdk15on-1.59.jar:/data/launcher/libs/io/sundr/sundr-core/0.9.2/sundr-core-0.9.2.jar:/data/launcher/libs/io/sundr/sundr-codegen/0.9.2/sundr-codegen-0.9.2.jar:/data/launcher/libs/io/sundr/resourcecify-annotations/0.9.2/resourcecify-annotations-0.9.2.jar:/data/launcher/libs/com/squareup/okio/okio/1.6.0/okio-1.6.0.jar:/data/launcher/versions/3.0.0-RELEASE-e48128a/driver.jar:/data/temp/caches/wrapper.jar", de.dytanic.cloudnet.wrapper.Main, nogui]
And my current workdir is: /data/temp/services/Lobby-1#4a517311-09e6-4f77-89a5-64b4bc15399a
So whenever I am in the workdir and execute the given command, it fails with the following error: Error opening zip file or JAR manifest missing :
Error occurred during initialization of VM
agent library failed to init: instrument Full Log
Now I am wondering because it's working in the automatic-environment but there are no changes to the master-Branch Source e.g. a changed Path to /data/launcher instead of launcher (System.getProperty("cloudnet.launcher.dir", "/data/launcher"))[https://github.com/CloudNetService/CloudNet-v3/blob/master/cloudnet-launcher/src/main/java/de/dytanic/cloudnet/launcher/Constants.java].
A short lookup: ls -laR /Users/.../Documents/IdeaProjects/cloudnet-parent/data
javaagent option is misused. Correct syntax is
-javaagent:/data/temp/caches/wrapper.jar
I want to run keycloak container with below docker compose file.
version: '2.1'
services:
# keycloak
keycloak:
container_name: keycloak
image: jboss/keycloak:latest
restart: always
ports:
- 8080:8080
volumes:
- C:\logs\keycloak:/usr/app/logs
- C:\settings:/etc/settings
environment:
- KEYCLOAK_USER=admin
- KEYCLOAK_PASSWORD=admin
- KEYCLOAK_IMPORT=/etc/settings/realm.json
Everything except realm import works fine in this case.
This is shortcut of the error thrown during container run:
Caused by: java.lang.RuntimeException: RESTEASY003325: Failed to construct public org.keycloak.services.resources.KeycloakApplication(javax.servlet.ServletContext,org.jboss.resteasy.core.Dispatcher)
Caused by: java.lang.RuntimeException: java.io.FileNotFoundException: /etc/settings/realm.json (Is a directory)
Caused by: java.io.FileNotFoundException: /etc/settings/realm.json (Is a directory)"}`
I am sure the file exists in this location.
I have checked several different configurations for import e.g. specyfing imported file: C:\settings\realm.json:/etc/settings/realm.json but the result is the same.
Have you got any ideas how the proper configuration should look like?
I had the same issue. It was caused by the fact that I was attempting to mount a volume using a relative path. I resolved it by replacing all relative paths with absolute paths.
SOLVED
It appears that the error may be described as follows.
error: File is mounted as a directory or mounted directories are empty.
reason: Password change to OS.
explanation: Docker cannot access files on the system that it works on, as it is after all a virtual machine, due to system’s password change. It does not inform about fail in accessing the file system either, just displays mounted directories in an invalid manner.
UPDATE
So the problem in my case was that a system password - Windows, was changed and credentials in docker were not updated. Since it was some time ago I no longer remember how to change the saved credentials in docker, I recall it was easy in the UI, but I know that was the solution - update of the system credentials stored by docker.
I'm following the tutorial on Cassandra's site for the standalone server v2.1.1. I'm trying to get it running on a vagrant instance. JDK version is java version "1.7.0_72". Even when I start up Cassandra with sudo bin/cassandra -f, I get this error:
DEBUG 22:14:34 Creating new commit log segment /vagrant/apache-cassandra-2.1.1/out/commitlog/CommitLog-4-1415657674222.log
ERROR 22:14:34 Failed managing commit log segments. Commit disk failure policy is stop; terminating thread
org.apache.cassandra.io.FSWriteError: java.io.IOException: Invalid argument
at org.apache.cassandra.db.commitlog.CommitLogSegment.<init>(CommitLogSegment.java:177) ~[apache-cassandra-2.1.1.jar:2.1.1]
at org.apache.cassandra.db.commitlog.CommitLogSegment.freshSegment(CommitLogSegment.java:119) ~[apache-cassandra-2.1.1.jar:2.1.1]
at org.apache.cassandra.db.commitlog.CommitLogSegmentManager$1.runMayThrow(CommitLogSegmentManager.java:119) ~[apache-cassandra-2.1.1.jar:2.1.1]
at org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:28) [apache-cassandra-2.1.1.jar:2.1.1]
at java.lang.Thread.run(Thread.java:745) [na:1.7.0_72]
Caused by: java.io.IOException: Invalid argument
at sun.nio.ch.FileChannelImpl.map0(Native Method) ~[na:1.7.0_72]
at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:874) ~[na:1.7.0_72]
at org.apache.cassandra.db.commitlog.CommitLogSegment.<init>(CommitLogSegment.java:166) ~[apache-cassandra-2.1.1.jar:2.1.1]
The CommitLog file is created, but the server is still stopped.
What can I do to get cassandra running?
The /vagrant directory is a shared filesystem with the host (Mac OSX 10.10). The commit logs were written into a directory in this filesystem.
When I set the variable commitlog_directory in conf/cassandra.yaml to a directory that wasn't on the /vagrant shared drive, I was able to boot Cassandra.
This is a long standing bug on Virtualbox. It's an issue with memory mapped files; they aren't supported on the shared filesystem.
https://www.virtualbox.org/ticket/819