Questions tagged [docker-copy]

26 questions
1
vote
1 answer

ADD and COPY with existing relative path fails when building a docker image

Env: Windows 10, Docker Desktop (Docker Engine v20.10.6) Build of a Docker image fails on command COPY (and ADD) when its first argument is a relative path starting with ../../. Error message shows that any path like ../../a/b/c is replaced with…
diziaq
  • 6,881
  • 16
  • 54
  • 96
1
vote
2 answers

Docker add no such file or directory

The following is my root-directory: andrej: - docker/CodeExperiments.jar - docker2/Dockerfile Here are the contents of my Dockerfile: FROM java:8 ADD docker/CodeExperiments.jar docker/ RUN javac BirthDayTask.java And this is the command I am…
Jelly
  • 972
  • 1
  • 17
  • 40
0
votes
0 answers

Docker COPY --chown ownership sometimes applies to

I have the following Dockerfile FROM python:3.11 # Create non-root user to run with ARG USERNAME=bean ARG USER_UID=999 ARG USER_GID=$USER_UID RUN groupadd --gid $USER_GID $USERNAME && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME COPY…
Luciano
  • 426
  • 2
  • 9
  • 19
0
votes
0 answers

Docker-compose copy fille from volume to directory in another container

I have 2 services in docker-compose one downloads data, and creates a file and attaches it to a volume, which makes it accessible to other container. That works fine. The issue am having is, I want to append the file datadump.json in the /home-dir/…
Shammir
  • 927
  • 4
  • 17
  • 32
0
votes
0 answers

Running a 'Docker Compose' from Visual Studio includes a reference to docker-compose.vs.debug.g.yml which causes COPY command not to work properly

The Dockerfile COPY command is not actually copying a file into a container's file system when it was run via Visual Studio 'Docker Compose' start button (with or without debugging). Dockerfile excerpt: FROM base AS final WORKDIR /app COPY…
0
votes
1 answer

Why Is This File Copied to the Root of a Docker Image Instead of the Working Directory

Using the following Dockerfile: FROM alpine:latest WORKDIR /usr/src/app COPY ["somefile", "/"] and the build following command: docker build \ --file=Dockerfile \ --no-cache=true \ --progress=plain \ --tag=someimage:sometag \ . => #1…
Mike
  • 1,080
  • 1
  • 9
  • 25
0
votes
1 answer

Dockerfile COPY command copies file as a directory

Please note: this question mentions Java and Java keystores, but in reality has nothing to do with Java and should be answerable by anyone with sufficient knowledge of Docker and writing Dockerfiles. I have a web service (myservice) that is a JVM…
hotmeatballsoup
  • 385
  • 6
  • 58
  • 136
0
votes
1 answer

Copy Docker image to running container

Is there a way to copy a Docker image to a running container? Or perhaps the way to do it is to start a container with the new image and share a volume between it and other containers? Is there a way to add a volume to a running container?…
user7898461
0
votes
2 answers

How to reference embedded Docker resource files using file path URL

I have created a Docker image and embedded some static resource files within it, using the following command in the Dockerfile: COPY resources /resources I have a java web application running within the Docker container which requires access to…
ASH
  • 573
  • 2
  • 7
  • 20
-1
votes
1 answer

Dockerfile is unable to find and copy local file when building image

I am helping my team to migrate our tomcat based application which runs on Java 8. The application is using docker-compose-up which is using a docker-compose.yaml file to build several dependencies inside the project, a high level structure of this…
Edward Sun
  • 183
  • 2
  • 12
-3
votes
1 answer

Copy a file from a Docker to another Docker and execute it

As I mentioned above, I want to copy an executable file from a docker to another docker and run it. docker cp target/demo.jar test:/demo.jar is not working since docker cp can copy only "docker to host" or "host to docker". as a next step, I need…
RDD
  • 145
  • 1
  • 18
1
2