MozDef/Makefile

69 строки
2.1 KiB
Makefile
Исходник Обычный вид История

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
#
# Contributors:
2017-07-15 03:00:52 +03:00
# 2xyo <yohann@lepage.info>
# Yohann Lepage yohann@lepage.info
# Anthony Verez averez@mozilla.com
2017-07-15 03:00:52 +03:00
# Brandon Myers bmyers@mozilla.com
2014-04-01 08:06:49 +04:00
# usage:
2017-07-15 03:00:52 +03:00
# make single-build - build new single image from Dockerfile
# make single-debug - debug run already created image by tag
# make single-try - build and run in debug mode
# make single-run - run a single instance of MozDef
# make multiple-build - build new mozdef container environment (includes multiple containers)
# make multiple-clean - remove any mozdef container environments
# make multiple-run - run new mozdef environment from containers
2014-04-01 08:06:49 +04:00
NAME=mozdef
2014-04-01 08:06:49 +04:00
VERSION=0.1
2017-07-15 03:00:52 +03:00
single-build:
docker build -f docker/Dockerfile -t $(NAME):$(VERSION) .
2014-04-01 08:06:49 +04:00
2017-07-15 03:00:52 +03:00
single-build-no-cache:
docker build -f docker/Dockerfile --no-cache -t $(NAME):$(VERSION) .
2014-04-01 08:06:49 +04:00
2017-07-15 03:00:52 +03:00
single-run:
2017-07-13 02:58:48 +03:00
docker run \
-e TZ=UTC \
-p 80:80 \
-p 5672:5672 \
-p 9090:9090 \
-p 9200:9200 \
-p 8080:8080 \
-p 8081:8081 \
-h $(NAME) -d $(NAME):$(VERSION)
2014-04-01 08:06:49 +04:00
2017-07-15 03:00:52 +03:00
single-debug:build
2014-04-01 08:06:49 +04:00
docker run -p 3000:3000 -p 9090:9090 -p 9200:9200 -p 8080:8080 -p 8081:8081 \
-v $(shell pwd)/container/var/lib/elasticsearch:/var/lib/elasticsearch \
-v $(shell pwd)/container/var/log/elasticsearch:/var/log/elasticsearch \
-v $(shell pwd)/container/var/lib/mongodb:/var/lib/mongodb \
-v $(shell pwd)/container/var/log/mongodb:/var/log/mongodb \
-v $(shell pwd)/container/var/log/nginx:/var/log/nginx \
-v $(shell pwd)/container/var/log/mozdef:/var/log/mozdef \
2014-09-14 16:39:08 +04:00
-h $(NAME) -t -i $(NAME):$(VERSION) /bin/bash
2014-04-01 08:06:49 +04:00
2017-07-15 03:00:52 +03:00
single-try: build run
2014-04-01 08:06:49 +04:00
.PHONY: build debug run
2017-07-15 03:00:52 +03:00
multiple-run:
docker-compose -f docker/compose/docker-compose.yml -p $(NAME) up -d
multiple-build:
docker-compose -f docker/compose/docker-compose.yml -p $(NAME) build
multiple-stop:
docker-compose -f docker/compose/docker-compose.yml -p $(NAME) stop
2017-07-27 20:22:21 +03:00
multiple-rebuild: multiple-build multiple-stop multiple-run