Last active
September 22, 2015 18:43
-
-
Save gravis/8940487 to your computer and use it in GitHub Desktop.
Docker Volume sharing
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
FROM docker:5000/wheezy-ruby | |
# install deps | |
RUN apt-get install -y qt4-qmake libqtwebkit-dev libcurl4-openssl-dev | |
RUN mkdir -p /bundle /rails | |
RUN apt-get install -y ssh | |
RUN mkdir -p /var/run/sshd | |
RUN mkdir -p /root/.ssh | |
RUN echo "Host github.com\n\tStrictHostKeyChecking no\n" >> /root/.ssh/config | |
RUN echo "root:docker" | chpasswd | |
VOLUME ["/rails", "/bundle"] | |
ENTRYPOINT ["/usr/sbin/sshd", "-D"] | |
WORKDIR /rails | |
EXPOSE 22 |
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
all: build | |
build: | |
docker build -rm -t docker:5000/bundle . | |
run: | |
-docker run -name bundle -v `pwd`/../..:/rails -v /bundle -d -p 22 docker:5000/bundle | |
stop: | |
docker stop bundle | |
clean: | |
docker rm -v bundle | |
bundle: | |
sshpass -p "docker" ssh root@localhost -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p `docker port bundle 22 | cut -d':' -f2` -A 'bundle install --gemfile=/rails/Gemfile --path=/bundle' | |
docker commit bundle docker:5000/bundle |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment