Skip to content

Instantly share code, notes, and snippets.

@tw3
Created August 22, 2018 13:53
Show Gist options
  • Save tw3/5eddbdb22d4a60bf928f886613ed0540 to your computer and use it in GitHub Desktop.
Save tw3/5eddbdb22d4a60bf928f886613ed0540 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