docker cp
docker cp foo.txt mycontainer:/foo.txt
docker cp
docker cp foo.txt mycontainer:/foo.txt
copy file to docker container
docker cp foo.txt mycontainer:/foo.txt
docker command
docker ps # current containers
docker run # create and start the container
docker create # create container
dokcer exec # to run commnads in container for once
docker volume # create a docker volume
docker network # create a docker network
docker rm # remove container
docker images # list the images
docker rmi # remove image
docker build # build a new image from dockerfile
docker push # push your image to docker repo
docker pull # download an image from docker repo
docker commit # create an image from container
docker cp volume
Usage
docker cp [OPTIONS] CONTAINER:SRC_PATH DEST_PATH|-
docker cp [OPTIONS] SRC_PATH|- CONTAINER:DEST_PATH
To copy data from the volume to the host, use a temporary container that has the volume mounted.
CID=$(docker run -d -v hello:/hello busybox true)
docker cp $CID:/hello ./
To copy a directory from the host to volume
cd local_dir
docker cp . $CID:/hello/
Then clean up the temporary container.
docker rm $CID
docker scikit
# Use an official Python runtime as a parent image
FROM python:3.6-slim
# Set the working directory to /app
WORKDIR /app
# Copy the current directory contents into the container at /app
ADD . /app
# Install any needed packages specified in requirements.txt
RUN pip install -r requirements.txt
# Define environment variable
ENV NAME World
EXPOSE 5003
# Run app.py when the container launches
CMD ["python", "app.py"]
# requirements.txt
Flask==1.0
numpy
scipy
scikit-learn
pandas
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us