docker-gitlab/Makefile
Sameer Naik 5e2d8014be launch a redis container if we can connect to the host docker
When the redis connection parameters are not specified, the image
will try to spin up a redis container if it is able to communicate with
the host docker.

This is only possible if the following two options are specified in the
docker run command:
  `-v /var/run/docker.sock:/run/docker.sock`
  `-v $(which docker):/bin/docker`

This is primarily added to get the quick start guide to work without
much of a hassel.
2014-09-20 14:43:14 +05:30

39 lines
1007 B
Makefile

all: help
help:
@echo ""
@echo "-- Help Menu"
@echo ""
@echo " 1. make build - build the gitlab image"
@echo " 2. make start - start gitlab"
@echo " 3. make stop - stop gitlab"
@echo " 4. make logs - view logs"
@echo " 5. make purge - stop and remove the container"
build:
@docker build --tag=${USER}/gitlab .
start:
@echo "Starting gitlab..."
@docker run --name='gitlab-demo' -d \
-e 'GITLAB_PORT=10080' -e 'GITLAB_SSH_PORT=10022' \
-p 10022:22 -p 10080:80 \
-v /var/run/docker.sock:/run/docker.sock \
-v $(shell which docker):/bin/docker \
${USER}/gitlab:latest >/dev/null
@echo "GitLab instance is booting up..."
@echo "Please be patient. This could take a while..."
@echo "GitLab will be available at http://localhost:10080"
@echo "Type 'make logs' for the logs"
stop:
@echo "Stopping gitlab..."
@docker stop gitlab-demo >/dev/null
purge: stop
@echo "Removing stopped container..."
@docker rm gitlab-demo >/dev/null
logs:
@docker logs -f gitlab-demo