skip to Main Content

Image of httpd copy to local system found error

I want to know where is the docker image save and how we copy that image of httpd in local system?
I hope I will get my answer here!

2

Answers


  1. Your command

    docker cp <CONTAINER>:<SRC_PATH> <DEST_PATH>
    

    is the correct way to copy contents out of a container to the host.

    The issue is that the file that you are targetting here (/etc/httpd/conf) does not exist in the container. Maybe you meant the folder /usr/local/apache2/conf ?
    You can inspect the contents of the container by shelling into it using

    docker exec -it <CONTAINER> bash
    

    Or using a dummy copy of the container:

    docker run --rm -it httpd bash
    
    Login or Signup to reply.
  2. To the answer added by Chris, always check the docker hub’s httpd image page for detailed information on the config and refer to the official docker documentation on the usage of docker commands.

    httpd conf copy example steps:

    ~ docker pull httpd
    Using default tag: latest 
    latest: Pulling from library/httpd
    fcdb9667c46b: Already exists
    94864f1629dd: Already exists
    25732f3fbbaf: Already exists
    832bc635a9a3: Already exists
    2c82a6b36c38: Already exists
    Digest: sha256: f3e9eb9acace5bbc13c924293d2247a65bb59b8f062bcd98cd87ee4e18f86733
    Status: Downloaded newer image for httpd:latest
    docker.10/library/httpd:latest
    
    ~ docker run -d -p 8081:80 --name httpdtest httpd:latest
    fd45446076b4900879e048c53a99c71c325db0c360c7de3407bbb73ea8ca4c9
    
    ~ docker cp httpdtest:/usr/local/apache2/conf/httpd.conf httpdtest.conf
    
    ~ cat httpdtest.conf
    #
    # This is the main Apache HTTP server configuration file. It contains the
    # configuration directives that give the server its instructions.
    # See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
    # In particular, see
    # <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
    # for a discussion of each configuration directive.
    #
    # Do NOT simply read the instructions in here without understanding
    # what they do. They're here only as hints or reminders. If you are unsure
    # consult the online docs. You have been warned.
    #
    # Configuration and logfile names: If the filenames you specify for many
    ...
    

    Click here for httpd docker image configuration.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search