Skip to content

Instantly share code, notes, and snippets.

@rdallasgray
Last active February 23, 2017 08:29
Show Gist options
  • Save rdallasgray/e0fd083ce37638278b13f0542097891f to your computer and use it in GitHub Desktop.
Save rdallasgray/e0fd083ce37638278b13f0542097891f to your computer and use it in GitHub Desktop.
SSH_DIR=${shell cd ~/.ssh; pwd}
IMAGE_NAME=my_image
IMAGE_VERSION=0.0.1
IMAGE_TAG=${IMAGE_NAME}:${IMAGE_VERSION}
CONTAINER_NAME=${IMAGE_NAME}-${IMAGE_VERSION}
build:
@docker build \
--tag "${IMAGE_TAG}" \
.;
create:
@docker create \
--name="${CONTAINER_NAME}" \
--interactive \
--tty \
--publish-all \
--volume "bundle:/myproject/vendor" \
--volume "${SSH_DIR}:/root/.ssh" \
"${IMAGE_TAG}"; \
fi;
start: create
@docker start ${CONTAINER_NAME};
sh: start
docker exec -it ${CONTAINER_NAME} /bin/bash
.PHONY: build create start sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment