Skip to content

Instantly share code, notes, and snippets.

@baamenabar

baamenabar/flyimg-up.sh

Last active Jan 7, 2019
Embed
What would you like to do?
Don't forget how to build and start Flyimg in windows 10 home environment with Cmder (conEmu)
# Windows only: Don't forget how to build and start Flyimg in windows 10 home environment with Cmder (conEmu)
# Must have virtualbox installed, ideally through docker toolbox
# do this only once
docker-machine create --driver virtualbox default
# all the subsequent times, only this
docker-machine start default
# hook the virtual env to docker
docker-machine env default
#then cd into flyimg folder
cd ~/projects/flyimg
# check if the container image exists
docker image ls
# otherwise build the container basd on the Dockerfile from this directory
docker build -t flyimg .
# if there is an image to use, check if a container is not already created.
docker ps -a
# if there is no container start running one and mount the current folder (very careful with the folder path syntax in windows)
docker run -itd -p 8080:80 -v /c/Users/agust/projects/flyimg:/var/www/html --name flyimg flyimg
# you can now bash into the container (if you want)
docker exec -it flyimg bash
# Additionaly you can alias the mounted volume folder with the following:
# All credit to señor senyor: https://forums.docker.com/t/how-to-share-volumes-and-or-drives-using-docker-machine-on-windows-not-beta/20170/7
docker-machine stop
vboxmanage sharedfolder add default --name "project_name" --hostpath "<full_project_path>" --automount
docker-machine start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment