Docker compose : error copying nginx.conf fron nginx image












0















I am using a docker-compose.yml in which I describe 2 services , one for frontend app and the second one is for backend :



version: '2'
services:
cdl-front:
build: cdl-web/.
ports:
- "80:80"
depends_on:
- cdl-rest
cdl-rest:
build: cdl-rest/.
ports:
- "7777:7777"


When I try to launch my docker-compose configuration using IntelliJ IDEA configured with Docker plugin I get this error :




ERROR: Service 'cdl-front' failed to build: COPY failed: stat
/var/lib/docker/tmp/docker-builder939775883/nginx.conf: no such file
or directory Failed to deploy 'Compose: docker-compose.yml':
docker-compose process finished with exit code 1
Below is my 2 dockerfiles describing the 2 services :




cdl-front contain this dockerfile :



FROM nginx
WORKDIR .
COPY nginx.conf /etc/nginx/nginx.conf
COPY cdl-frontend/cdl /usr/share/nginx/html


cdl-rest contain this dockerfile



# Start with a base image containing Java runtime
FROM openjdk:8-jdk-alpine

# Add Maintainer Info
LABEL maintainer="ghassen1khalil@gmail.com"

# Add a volume pointing to /tmp
VOLUME /tmp

# Make port 8080 available to the world outside this container
EXPOSE 9091

# The application's jar file
ARG JAR_FILE=target/cdl-rest-1.0-SNAPSHOT.jar

# Add the application's jar to the container
ADD ${JAR_FILE} cdl-rest.jar

# Run the jar file
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom -Dfile.encoding=UTF-8","-jar","/cdl-rest.jar"]
CMD ["--env=prod"]









share|improve this question























  • What the file/directory structure in the directory containing Dockerfile?

    – Hansika Madushan Weerasena
    Dec 31 '18 at 4:00











  • I have 2 dockerfiles and a docker-compose on the root, you can see this link for the structure pastebin.com/3CMLaiwX

    – ghassen
    Dec 31 '18 at 19:53













  • Where is in the structure nginx.conf placed? And when you try to build it from shell using docker-compose build instead of IDEA plugin, does it work?

    – michalhosna
    Jan 1 at 21:10











  • @michalhosna nginx.conf is packed within the official nginx image I think .. I'm not overriding it. When I try to build it from shell I get the same error : Service 'cdl-front' failed to build: COPY failed: stat /var/lib/docker/tmp/docker-builder045278574/nginx.conf: no such file or directory

    – ghassen
    Jan 2 at 10:24






  • 1





    @michalhosna as I am starting Docker I didn't knew that COPY do this ! Now I remved it and it works fine. Thank you anyway :)

    – ghassen
    Jan 2 at 14:54
















0















I am using a docker-compose.yml in which I describe 2 services , one for frontend app and the second one is for backend :



version: '2'
services:
cdl-front:
build: cdl-web/.
ports:
- "80:80"
depends_on:
- cdl-rest
cdl-rest:
build: cdl-rest/.
ports:
- "7777:7777"


When I try to launch my docker-compose configuration using IntelliJ IDEA configured with Docker plugin I get this error :




ERROR: Service 'cdl-front' failed to build: COPY failed: stat
/var/lib/docker/tmp/docker-builder939775883/nginx.conf: no such file
or directory Failed to deploy 'Compose: docker-compose.yml':
docker-compose process finished with exit code 1
Below is my 2 dockerfiles describing the 2 services :




cdl-front contain this dockerfile :



FROM nginx
WORKDIR .
COPY nginx.conf /etc/nginx/nginx.conf
COPY cdl-frontend/cdl /usr/share/nginx/html


cdl-rest contain this dockerfile



# Start with a base image containing Java runtime
FROM openjdk:8-jdk-alpine

# Add Maintainer Info
LABEL maintainer="ghassen1khalil@gmail.com"

# Add a volume pointing to /tmp
VOLUME /tmp

# Make port 8080 available to the world outside this container
EXPOSE 9091

# The application's jar file
ARG JAR_FILE=target/cdl-rest-1.0-SNAPSHOT.jar

# Add the application's jar to the container
ADD ${JAR_FILE} cdl-rest.jar

# Run the jar file
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom -Dfile.encoding=UTF-8","-jar","/cdl-rest.jar"]
CMD ["--env=prod"]









share|improve this question























  • What the file/directory structure in the directory containing Dockerfile?

    – Hansika Madushan Weerasena
    Dec 31 '18 at 4:00











  • I have 2 dockerfiles and a docker-compose on the root, you can see this link for the structure pastebin.com/3CMLaiwX

    – ghassen
    Dec 31 '18 at 19:53













  • Where is in the structure nginx.conf placed? And when you try to build it from shell using docker-compose build instead of IDEA plugin, does it work?

    – michalhosna
    Jan 1 at 21:10











  • @michalhosna nginx.conf is packed within the official nginx image I think .. I'm not overriding it. When I try to build it from shell I get the same error : Service 'cdl-front' failed to build: COPY failed: stat /var/lib/docker/tmp/docker-builder045278574/nginx.conf: no such file or directory

    – ghassen
    Jan 2 at 10:24






  • 1





    @michalhosna as I am starting Docker I didn't knew that COPY do this ! Now I remved it and it works fine. Thank you anyway :)

    – ghassen
    Jan 2 at 14:54














0












0








0








I am using a docker-compose.yml in which I describe 2 services , one for frontend app and the second one is for backend :



version: '2'
services:
cdl-front:
build: cdl-web/.
ports:
- "80:80"
depends_on:
- cdl-rest
cdl-rest:
build: cdl-rest/.
ports:
- "7777:7777"


When I try to launch my docker-compose configuration using IntelliJ IDEA configured with Docker plugin I get this error :




ERROR: Service 'cdl-front' failed to build: COPY failed: stat
/var/lib/docker/tmp/docker-builder939775883/nginx.conf: no such file
or directory Failed to deploy 'Compose: docker-compose.yml':
docker-compose process finished with exit code 1
Below is my 2 dockerfiles describing the 2 services :




cdl-front contain this dockerfile :



FROM nginx
WORKDIR .
COPY nginx.conf /etc/nginx/nginx.conf
COPY cdl-frontend/cdl /usr/share/nginx/html


cdl-rest contain this dockerfile



# Start with a base image containing Java runtime
FROM openjdk:8-jdk-alpine

# Add Maintainer Info
LABEL maintainer="ghassen1khalil@gmail.com"

# Add a volume pointing to /tmp
VOLUME /tmp

# Make port 8080 available to the world outside this container
EXPOSE 9091

# The application's jar file
ARG JAR_FILE=target/cdl-rest-1.0-SNAPSHOT.jar

# Add the application's jar to the container
ADD ${JAR_FILE} cdl-rest.jar

# Run the jar file
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom -Dfile.encoding=UTF-8","-jar","/cdl-rest.jar"]
CMD ["--env=prod"]









share|improve this question














I am using a docker-compose.yml in which I describe 2 services , one for frontend app and the second one is for backend :



version: '2'
services:
cdl-front:
build: cdl-web/.
ports:
- "80:80"
depends_on:
- cdl-rest
cdl-rest:
build: cdl-rest/.
ports:
- "7777:7777"


When I try to launch my docker-compose configuration using IntelliJ IDEA configured with Docker plugin I get this error :




ERROR: Service 'cdl-front' failed to build: COPY failed: stat
/var/lib/docker/tmp/docker-builder939775883/nginx.conf: no such file
or directory Failed to deploy 'Compose: docker-compose.yml':
docker-compose process finished with exit code 1
Below is my 2 dockerfiles describing the 2 services :




cdl-front contain this dockerfile :



FROM nginx
WORKDIR .
COPY nginx.conf /etc/nginx/nginx.conf
COPY cdl-frontend/cdl /usr/share/nginx/html


cdl-rest contain this dockerfile



# Start with a base image containing Java runtime
FROM openjdk:8-jdk-alpine

# Add Maintainer Info
LABEL maintainer="ghassen1khalil@gmail.com"

# Add a volume pointing to /tmp
VOLUME /tmp

# Make port 8080 available to the world outside this container
EXPOSE 9091

# The application's jar file
ARG JAR_FILE=target/cdl-rest-1.0-SNAPSHOT.jar

# Add the application's jar to the container
ADD ${JAR_FILE} cdl-rest.jar

# Run the jar file
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom -Dfile.encoding=UTF-8","-jar","/cdl-rest.jar"]
CMD ["--env=prod"]






nginx docker-compose nginx-config






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 30 '18 at 20:18









ghassenghassen

88211




88211













  • What the file/directory structure in the directory containing Dockerfile?

    – Hansika Madushan Weerasena
    Dec 31 '18 at 4:00











  • I have 2 dockerfiles and a docker-compose on the root, you can see this link for the structure pastebin.com/3CMLaiwX

    – ghassen
    Dec 31 '18 at 19:53













  • Where is in the structure nginx.conf placed? And when you try to build it from shell using docker-compose build instead of IDEA plugin, does it work?

    – michalhosna
    Jan 1 at 21:10











  • @michalhosna nginx.conf is packed within the official nginx image I think .. I'm not overriding it. When I try to build it from shell I get the same error : Service 'cdl-front' failed to build: COPY failed: stat /var/lib/docker/tmp/docker-builder045278574/nginx.conf: no such file or directory

    – ghassen
    Jan 2 at 10:24






  • 1





    @michalhosna as I am starting Docker I didn't knew that COPY do this ! Now I remved it and it works fine. Thank you anyway :)

    – ghassen
    Jan 2 at 14:54



















  • What the file/directory structure in the directory containing Dockerfile?

    – Hansika Madushan Weerasena
    Dec 31 '18 at 4:00











  • I have 2 dockerfiles and a docker-compose on the root, you can see this link for the structure pastebin.com/3CMLaiwX

    – ghassen
    Dec 31 '18 at 19:53













  • Where is in the structure nginx.conf placed? And when you try to build it from shell using docker-compose build instead of IDEA plugin, does it work?

    – michalhosna
    Jan 1 at 21:10











  • @michalhosna nginx.conf is packed within the official nginx image I think .. I'm not overriding it. When I try to build it from shell I get the same error : Service 'cdl-front' failed to build: COPY failed: stat /var/lib/docker/tmp/docker-builder045278574/nginx.conf: no such file or directory

    – ghassen
    Jan 2 at 10:24






  • 1





    @michalhosna as I am starting Docker I didn't knew that COPY do this ! Now I remved it and it works fine. Thank you anyway :)

    – ghassen
    Jan 2 at 14:54

















What the file/directory structure in the directory containing Dockerfile?

– Hansika Madushan Weerasena
Dec 31 '18 at 4:00





What the file/directory structure in the directory containing Dockerfile?

– Hansika Madushan Weerasena
Dec 31 '18 at 4:00













I have 2 dockerfiles and a docker-compose on the root, you can see this link for the structure pastebin.com/3CMLaiwX

– ghassen
Dec 31 '18 at 19:53







I have 2 dockerfiles and a docker-compose on the root, you can see this link for the structure pastebin.com/3CMLaiwX

– ghassen
Dec 31 '18 at 19:53















Where is in the structure nginx.conf placed? And when you try to build it from shell using docker-compose build instead of IDEA plugin, does it work?

– michalhosna
Jan 1 at 21:10





Where is in the structure nginx.conf placed? And when you try to build it from shell using docker-compose build instead of IDEA plugin, does it work?

– michalhosna
Jan 1 at 21:10













@michalhosna nginx.conf is packed within the official nginx image I think .. I'm not overriding it. When I try to build it from shell I get the same error : Service 'cdl-front' failed to build: COPY failed: stat /var/lib/docker/tmp/docker-builder045278574/nginx.conf: no such file or directory

– ghassen
Jan 2 at 10:24





@michalhosna nginx.conf is packed within the official nginx image I think .. I'm not overriding it. When I try to build it from shell I get the same error : Service 'cdl-front' failed to build: COPY failed: stat /var/lib/docker/tmp/docker-builder045278574/nginx.conf: no such file or directory

– ghassen
Jan 2 at 10:24




1




1





@michalhosna as I am starting Docker I didn't knew that COPY do this ! Now I remved it and it works fine. Thank you anyway :)

– ghassen
Jan 2 at 14:54





@michalhosna as I am starting Docker I didn't knew that COPY do this ! Now I remved it and it works fine. Thank you anyway :)

– ghassen
Jan 2 at 14:54












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53981110%2fdocker-compose-error-copying-nginx-conf-fron-nginx-image%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53981110%2fdocker-compose-error-copying-nginx-conf-fron-nginx-image%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Mossoró

Error while reading .h5 file using the rhdf5 package in R

Pushsharp Apns notification error: 'InvalidToken'