Skip to content

Instantly share code, notes, and snippets.

@tw3
Created August 22, 2018 13:53
Show Gist options
  • Save tw3/d8acc7378fa01d59a64caeff9606d24a to your computer and use it in GitHub Desktop.
Save tw3/d8acc7378fa01d59a64caeff9606d24a to your computer and use it in GitHub Desktop.
Run a bash shell inside a node docker container with a shared volume
#!/usr/bin/env bash
docker run -it --name container1 -v /home/tweatherly/dir:/home/node/app node:8 bash
# /home/tweatherly/dir is the local machine directory to share
# /home/node/app is the the mapped directory within the node container
#
# you can specify a custom shell instead of node:8, e.g.
# pmoreau/node8-npm5-ngcli:8.9.3-5.5.1-6.0.3
# Run this command afterwards to remove the container
# docker rm container1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment