Skip to content

Instantly share code, notes, and snippets.

@joao-fontenele
Created September 26, 2019 19:21
Show Gist options
  • Save joao-fontenele/9bf205e45c9c813716a343eefc1f298e to your computer and use it in GitHub Desktop.
Save joao-fontenele/9bf205e45c9c813716a343eefc1f298e to your computer and use it in GitHub Desktop.
#!/bin/bash
# USAGE: ./copy-docker.sh nginx:stable-alpine /etc/nginx/nginx.conf nginx.conf
image=$1
src=$2
dest=$3
container_name="copy-docker-temp"
docker create -it --name ${container_name} ${image} bash
docker cp ${container_name}:${src} $dest
docker rm -f ${container_name}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment