# Error with copy target .war :s

**URL:** <https://forums.docker.com/t/error-with-copy-target-war-s/46735>\
**Category:** General\
**Tags:** docker\
**Created:** [February 21, 2018, 11:00am UTC](https://forums.docker.com/t/error-with-copy-target-war-s/46735 "2018-02-21T11:00:03Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![rucko24](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/rucko24/32/18977_2.png) [@rucko24](https://forums.docker.com/u/rucko24)\
**Post date:** [February 21, 2018, 11:00am UTC](https://forums.docker.com/t/error-with-copy-target-war-s/46735/1 "2018-02-21T11:00:03Z")

</div>

Hello, how are you here? , what a great community 😉 I’m starting with docker, I have a dockerFile that I created with my intellJ.

My image is apparently created fine, it does all the steps

**[gcr.io/google-appengine/tomcat:latest](http://gcr.io/google-appengine/tomcat:latest)**  
**_This is my sha256_**  
**sha256:f6b79e29d820cd3446902b36b9d1c401858d37b7554384c203a7e0d0bd25f9e5**

I have the **DockerIntegration** plugin

- Version: 173.3727.15  
This plugin lets you download and build Docker images, create and start Docker containers, and carry out other related tasks. Documentation  
Change Notes  
173.2605:  
IDEA-171370 - Docker: new UI for Docker Deployment Run configuration - separate config types  
IDEA-174375 - Docker run configuration - support --build-arg’s  
IDEA-172716 - Docker - allow build-only Dockerfile run configurations  
IDEA-174209 - Support custom dockerfile names  
IDEA-154517 - Docker: support alternate names for compose yml  
IDEA-170244 - Docker: provide completion and navigation for ADD instruction values  
#######################################################################  
**DockerFile**  
FROM gcr. io /google-appengine/tomcat  
COPY target/MyWar.war /var/lib/tomcat/webapps/ROOT.war  
##########################################################  
Deploying ’ Dockerfile: Dockerfile’…  
Building image…  
Step 1/2 : FROM [gcr.io/google-appengine/tomcat](http://gcr.io/google-appengine/tomcat)

—\> f6b79e29d820

Step 2/2 : COPY target/MyWar.war /var/lib/tomcat/webapps/ROOT.war

**I get this error**

**Error:** ResponseItem.ErrorDetail[code=,message=COPY failed: stat /var/lib/docker/tmp/docker-builder032902590/target/MyWar.war: no such file or directory]  
Failed to deploy ’ Dockerfile: Dockerfile’: COPY failed: stat /var/lib/docker/tmp/docker-builder032902590/target/MyWar.war: no such file or directory

---

<div class="post-metadata">

**Author:** ![sdetweil](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@sdetweil](https://forums.docker.com/u/sdetweil)\
**Post date:** [February 21, 2018, 11:59am UTC](https://forums.docker.com/t/error-with-copy-target-war-s/46735/2 "2018-02-21T11:59:07Z")

</div>

> [@rucko24](#):
>
> COPY target/

that folder, **target,** is in the same folder as your dockerfile, right?

---

<div class="post-metadata">

**Author:** ![rucko24](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/rucko24/32/18977_2.png) [@rucko24](https://forums.docker.com/u/rucko24)\
**Post date:** [February 21, 2018, 4:24pm UTC](https://forums.docker.com/t/error-with-copy-target-war-s/46735/3 "2018-02-21T16:24:35Z")

</div>

yes sir, thks It is just as it appears in the image

---

<div class="post-metadata">

**Author:** ![sdetweil](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@sdetweil](https://forums.docker.com/u/sdetweil)\
**Post date:** [February 21, 2018, 4:53pm UTC](https://forums.docker.com/t/error-with-copy-target-war-s/46735/4 "2018-02-21T16:53:43Z")

</div>

the Dockerfile COPY command copies FROM the docker HOST to the image…

so, that folder

```auto
'COPY' **target** /MyWar.war'  

```

MUST Be on the docker HOST and in the same folder as the dockerfile, during docker build command execution.  
(same folder cause it is a relative path)

---

<div class="post-metadata">

**Author:** ![rucko24](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/rucko24/32/18977_2.png) [@rucko24](https://forums.docker.com/u/rucko24)\
**Post date:** [February 21, 2018, 7:17pm UTC](https://forums.docker.com/t/error-with-copy-target-war-s/46735/5 "2018-02-21T19:17:36Z")

</div>

If it is the same, both the destination folder and the DockerFile are in the same directory,  
I see that great detail, the file MyWar.war is not XD, obviously it should be in the target compilation folder but not

if so, I should check that my .war is created well to continue

---

<div class="post-metadata">

**Author:** ![sdetweil](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@sdetweil](https://forums.docker.com/u/sdetweil)\
**Post date:** [February 21, 2018, 7:48pm UTC](https://forums.docker.com/t/error-with-copy-target-war-s/46735/6 "2018-02-21T19:48:21Z")

</div>

yes, the war needs to be in that folder

---

<div class="post-metadata">

**Author:** ![rucko24](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/rucko24/32/18977_2.png) [@rucko24](https://forums.docker.com/u/rucko24)\
**Post date:** [February 21, 2018, 9:12pm UTC](https://forums.docker.com/t/error-with-copy-target-war-s/46735/7 "2018-02-21T21:12:37Z")

</div>

It was just that, already generate \*.war so I see my application is not displayed in the browser through the ports

I’m interested in localhost:8080, simple

This configuration was added by me  
Container Port: 32768  
protocol: tcp  
Host IP: 0.0.0.0  
Host port: 8080

{  
“Args” : [“/bin/bash”, “/usr/local/tomcat/bin/catalina.sh”, “run”],  
“Config” : {  
“AttachStderr” : false,  
“AttachStdin” : true,  
“AttachStdout” : false,  
“Cmd” : [“/bin/bash”, “/usr/local/tomcat/bin/catalina.sh”, “run”],  
“Domainname” : “2ecee4a71c05”,  
“Entrypoint” : [“/docker-entrypoint.bash”],  
“Env” : [“PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin”, “PORT=8080”, “DEBIAN\_FRONTEND=noninteractive”, “OPENJDK\_VERSION=8u131”, “GAE\_IMAGE\_NAME=openjdk8”, “GAE\_IMAGE\_LABEL=8-2018-01-03-19-34”, “APP\_DESTINATION=/var/lib/tomcat/webapps/ROOT.war”, “CATALINA\_HOME=/usr/local/tomcat”, “CATALINA\_BASE=/var/lib/tomcat”, “APP\_WAR=ROOT.war”, “APP\_EXPLODED\_WAR=ROOT/”, “APP\_DESTINATION\_PATH=/var/lib/tomcat/webapps/”, “APP\_DESTINATION\_WAR=/var/lib/tomcat/webapps/ROOT.war”, “APP\_DESTINATION\_EXPLODED\_WAR=/var/lib/tomcat/webapps/ROOT/”],  
“ExposedPorts” : {  
“32768/tcp” : { },  
“8080/tcp” : { }  
},  
“Hostname” : “2ecee4a71c05”,  
“Image” : “34d7a0e6e1f7”,  
“Labels” : { },  
“OpenStdin” : true,  
“StdinOnce” : false,  
“Tty” : true,  
“User” : “”,  
“WorkingDir” : “/var/lib/tomcat/webapps”  
},  
“Created” : “2018-02-21T20:21:28.984714293Z”,  
“Driver” : “overlay2”,  
“ExecDriver” : null,  
“HostConfig” : {  
“Binds” : [],  
“BlkioWeight” : 0,  
“ContainerIDFile” : “”,  
“CpuPeriod” : 0,  
“CpuShares” : 0,  
“CpuQuota” : 0,  
“CpusetCpus” : “”,  
“CpusetMems” : “”,  
“Dns” : [],  
“DnsSearch” : [],  
“LogConfig” : {  
“Type” : “json-file”,  
“Config” : { }  
},  
“Memory” : 0,  
“MemorySwap” : 0,  
“MemoryReservation” : 0,  
“KernelMemory” : 0,  
“NetworkMode” : “default”,  
“OomKillDisable” : false,  
“OomScoreAdj” : false,  
“PortBindings” : { },  
“Privileged” : false,  
“PublishAllPorts” : false,  
“ReadonlyRootfs” : false,  
“RestartPolicy” : {  
“MaximumRetryCount” : 0,  
“Name” : “”  
},  
“PidMode” : “”,  
“CgroupParent” : “”,  
“VolumeDriver” : “”,  
“ShmSize” : 67108864,  
“PidsLimit” : 0  
},  
“HostnamePath” : “/var/lib/docker/containers/39e9981462532ed854bb78c02cabb70a3398b5969fb8edc3786bed9d5b7bcc52/hostname”,  
“HostsPath” : “/var/lib/docker/containers/39e9981462532ed854bb78c02cabb70a3398b5969fb8edc3786bed9d5b7bcc52/hosts”,  
“LogPath” : “/var/lib/docker/containers/39e9981462532ed854bb78c02cabb70a3398b5969fb8edc3786bed9d5b7bcc52/39e9981462532ed854bb78c02cabb70a3398b5969fb8edc3786bed9d5b7bcc52-json.log”,  
“Id” : “39e9981462532ed854bb78c02cabb70a3398b5969fb8edc3786bed9d5b7bcc52”,  
“SizeRootFs” : null,  
“Image” : “sha256:34d7a0e6e1f73446ddf7ed481c3fde427747bb23ee65fc208c5c9c53e7e46ca8”,  
“MountLabel” : “”,  
“Name” : “/suspicious\_hodgkin”,  
“RestartCount” : 0,  
“NetworkSettings” : {  
“Bridge” : “”,  
“SandboxID” : “cfece13f868d5fb89682ba004b24d31d2969c51f43f466a5afbfa9f7e4a356fc”,  
“HairpinMode” : false,  
“LinkLocalIPv6Address” : “”,  
“LinkLocalIPv6PrefixLen” : 0,  
“Ports” : {  
“32768/tcp” : null,  
“8080/tcp” : null  
},  
“SandboxKey” : “/var/run/docker/netns/cfece13f868d”,  
“SecondaryIPAddresses” : null,  
“SecondaryIPv6Addresses” : null,  
“EndpointID” : “97294f0599bb6a11050244616585285142ea27ab9cd756a31c3c5d651ea8381e”,  
“Gateway” : “172.17.0.1”,  
“PortMapping” : null,  
“GlobalIPv6Address” : “”,  
“GlobalIPv6PrefixLen” : 0,  
“IPAddress” : “172.17.0.2”,  
“IPPrefixLen” : 16,  
“IPv6Gateway” : “”,  
“MacAddress” : “02:42:ac:11:00:02”,  
“Networks” : {  
“bridge” : {  
“IPAMConfig” : null,  
“Links” : null,  
“Aliases” : null,  
“NetworkID” : “e6085de4f64e0d9b833dbfe936876bcbe3ae0c55a88b3b81c6a9a92dfe5b769c”,  
“EndpointID” : “97294f0599bb6a11050244616585285142ea27ab9cd756a31c3c5d651ea8381e”,  
“Gateway” : “172.17.0.1”,  
“IPAddress” : “172.17.0.2”,  
“IPPrefixLen” : 16,  
“IPv6Gateway” : “”,  
“GlobalIPv6Address” : “”,  
“GlobalIPv6PrefixLen” : 0,  
“MacAddress” : “02:42:ac:11:00:02”  
}  
}  
},  
“Path” : “/docker-entrypoint.bash”,  
“ProcessLabel” : “”,  
“ResolvConfPath” : “/var/lib/docker/containers/39e9981462532ed854bb78c02cabb70a3398b5969fb8edc3786bed9d5b7bcc52/resolv.conf”,  
“ExecIDs” : null,  
“State” : {  
“oomkilled” : false,  
“Status” : “running”,  
“Running” : true,  
“Paused” : false,  
“Restarting” : false,  
“OOMKilled” : false,  
“Dead” : false,  
“Pid” : 6789,  
“ExitCode” : 0,  
“Error” : “”,  
“StartedAt” : “2018-02-21T20:35:09.452807978Z”,  
“FinishedAt” : “2018-02-21T20:35:00.63181189Z”,  
“Health” : null  
},  
“Volumes” : null,  
“VolumesRW” : null,  
“Mounts” : []  
}

---

<div class="post-metadata">

**Author:** ![rucko24](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/rucko24/32/18977_2.png) [@rucko24](https://forums.docker.com/u/rucko24)\
**Post date:** [February 22, 2018, 8:01pm UTC](https://forums.docker.com/t/error-with-copy-target-war-s/46735/8 "2018-02-22T20:01:14Z")

</div>

That was my problem to build the .war and port binding and ready, solved and functional for me thanks for everything.

---

<div class="post-metadata">

**Author:** ![swagats](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@swagats](https://forums.docker.com/u/swagats)\
**Post date:** [May 20, 2019, 11:53am UTC](https://forums.docker.com/t/error-with-copy-target-war-s/46735/9 "2019-05-20T11:53:45Z")

</div>

Hi … I have a doubt here. Sorry if I am asking any stupid question. How to find the destination for tomcat in a container. Here it is mentioned /var/lib/tomcat/webapps. Is it same for all. I am creating a dockerfile- From tomcat. So could you please tell me what should be my destination path for .war to deploy.
