Copy files to a stopped Docker container (and vice versa)

Copy files to a stopped Docker container (and vice versa)


Recently I had to copy a file to docker container to make some immediate changes on it. The container crashed and kept restarting every time we try to bring it up, so I was not able to access the container's file system. So while looking for a solution, I learned that it's possible to copy a file to a stopped container using the docker cp command.

You can also use the same command to copy a file from the docker container to your local environment.

This is how to copy a file into a docker container.

docker cp <local-filename> <container-name>:<file-location-to-copy>

Here's an example:

docker cp AppData integrationapi:/usr/local/src/integrationapi/AppData

That's it...I hope this will help someone :)

6 comments :

  1. Hi, I’m Theodore Ginsburg and I live in Singapore. I’m here to share my own view to the world about how I was helped by Lord Zakuza with his powerful spells for bringing back my boyfriend who neglected and broke up with me for the past 2 and half years. I can’t say much because I really don’t know how to express myself right now for I’m overwhelmed but I really want to appreciate and thank Lord Zakuza for his honesty and gracious work in my life. Thank you xoxo much. Anyone reading this that needs his service can get in touch with him through his WhatsApp number on +17405739483 or via Email on: doctorzakuzaspelltemple@hotmail.com

    ReplyDelete
  2. How to have your husband back home with your kids again
    I'm a lady with 2 kids i am from Houston Texa, my husband leave me and his 2 kids for about 10 months i go through a lot of pain i do all i could to make him returned to me and to his kids but nothing works out. it was really a stressful period to me because i could dint go through the heartbreak. i was told to get a love spell doctor contacted to help me out which i did i was lucky to get DR.PEPOKO Contact who was able to help me out, he cast up a love spell that brought back my husband to me and to his kids thanks so much DR. PEPOKO I really appreciate what you have done for me. here he his contact if you may required for it by solving your relationship email. Pepokospiritemple@gmail.com call whatssap +2348156148821
    Here is also Dr. PEPOKO website you can visit it yourself www.pepokospiritemple.blogspot.com

    ReplyDelete
    Replies
    1. this is real take it serious, who will believe that a herb can cure ten
      years HIV in my body, i never believe that this will work i have spend a
      lot when getting drugs from the hospital to keep me healthy, what i was
      waiting for is death because i was broke, one day i hard about this great
      man who is well know of HIV and cancer cure, i decided to email him,
      unknowingly to me that this will be the end of the HIV aids in my body, he
      prepare the herb for me, and give me instruction on how to take it, at the
      end of the two week, he told me to go to the hospital for a check up, and i
      went, surprisingly after the test the doctor confirm me negative, i thought
      it was a joke, i went to other hospital was also negative, then i took my
      friend who was also HIV positive to the Dr voodoo after the treatment she
      was also confirm negative . He also have the herb to cure cancer please i
      want every one with this virus to be free, that is why am dropping his
      email address, voodoospelltemple66@gmail.com
      i want you to email him he is a great man. the government is also
      interested in this Dr voodoo thank you for saving my life, and I promise I
      will always testify for your good work you can also add him on whatsApp
      +2348140120719

      Delete
  3. Believe it or not he is the spell caster that can help you without lies.Are you depressed and don't know what to do anymore because of the situation you have found yourself in life or have you been ripped off by those fake spell caster online that ripped my friend out of $7000 dollars before she meant with Dr Kuq Ya that restored back her marriage? Kindly send your email to the following email address to get solutions to any problem you find yourself.: great.spellcaster@yahoo.com and get your problem solved without fail. I Gloria Kifita a Citizen of the United Kingdom say contact the spell caster and you will not regret it at all as i am not trying to place fake testimony about him like so many fake and lies about the scammers online. AS THIS IS A TRUE LIFE STORY.

    ReplyDelete
  4. Beware of online spell or to fix your broken marriage or relationship problem or after a divorce or Breakup,I was recently scam by two of them, until one faithful day i meet a man called Dr Oseiboh who help me to get back to the mother of my 2 kids after we have been separated for 3 years,I only pay for the items required for the spell and he cast the spell for me within 48hours my ex wife called me and beg me to forgive her for everything and we are back together.if you need a real and quick love spell or you are passing through pregnancy problem Dr Oseiboh is the answer, Please if any body needs. LOVE SPELL,LOTTERY,PREGNANCY SPELL, DIVORCE SPELL,STOP COURT CASE AND WIN ANY COURT PROBLEM,DEATH SPELL,BUSINESS SPELL AND MANY MORE YOU MAY NEED. Email him now for your own help. via email droseiboh12@gmail.com add him on whatsapp line or call +2347017565415.

    ReplyDelete