Created
February 3, 2018 20:07
-
-
Save t27/4b2808a821cdf5da1afed9386139f412 to your computer and use it in GitHub Desktop.
Virtual Linux docker for compiling apps etc.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run this command to create the docker container | |
docker run \ | |
--name ubuntuDev \ #containername | |
-e HOST_IP=$(ifconfig en0 | awk '/ *inet /{print $2}') \ #map the system and container Its, helpful for dev | |
-v ~/Code:/Code \ #mount the local directory on the container | |
-t -i \ | |
ubuntu:14.04 /bin/bash | |
# This created a container called ubuntuDev using the 'ubuntu:14.04' image from docker hub and runs bash interactively. | |
# -e ensures your networks are mapped correctly | |
# Also '-v' ensures that your local directory at ~/Code is mounted as /Code within the container, | |
# so you can actually write code in your OS and compile within docker. | |
# Now, once you exit the bash session that was created, to resume and reload the same container, do this | |
docker exec \ | |
-e HOST_IP=$(ifconfig en0 | awk '/ *inet /{print $2}') \ | |
-t -i \ | |
ubuntuDev /bin/bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment