Skip to content

Instantly share code, notes, and snippets.

@kgizdov
Last active November 15, 2016 14:32
Show Gist options
  • Save kgizdov/d2cc744d4a9ea1d80317bcbfefe01754 to your computer and use it in GitHub Desktop.
Save kgizdov/d2cc744d4a9ea1d80317bcbfefe01754 to your computer and use it in GitHub Desktop.
Update docker image
#!/bin/bash
IMAGENAME=$1
LOCALFILE=$2
DESTINATION=$3
DIR=$(dirname $3)
docker run -i ${IMAGENAME} /bin/bash -c 'mkdir -p "$1" && cat > "$2"' -- ${DIR} ${DESTINATION} < ${LOCALFILE}
docker commit `docker ps -l -q` ${IMAGENAME}:latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment