-
Notifications
You must be signed in to change notification settings - Fork 24
/
Makefile
40 lines (30 loc) · 1.05 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
.PHONY: all
all: clean build binary
DOCKER_IMAGE_PREFIX=xebxeb/fasttext-docker# must be lower case
DOCKER_BUILD_CMD=docker build
clean:
rm -rf examples/data
rm -rf examples/result
build:
$(DOCKER_BUILD_CMD) -t $(DOCKER_IMAGE_PREFIX):devel -f Dockerfile .
$(DOCKER_BUILD_CMD) -t $(DOCKER_IMAGE_PREFIX):latest -f Dockerfile .
binary: build
docker run --rm $(DOCKER_IMAGE_PREFIX):devel cat ./fasttext > fasttext.bin
chmod +x fasttext.bin
$(DOCKER_BUILD_CMD) -t $(DOCKER_IMAGE_PREFIX):binary -f Dockerfile.binary .
rm fasttext.bin
# -----
# Other make options below
# -----
test:
docker run --rm -it $(DOCKER_IMAGE_PREFIX):devel ./word-vector-example.sh
docker run --rm -it $(DOCKER_IMAGE_PREFIX):devel ./classification-example.sh
docker run --rm -it $(DOCKER_IMAGE_PREFIX):devel ./classification-results.sh
run:
docker run --rm -it $(DOCKER_IMAGE_PREFIX):devel /bin/bash
example:
cd examples && ./classification-example.sh
publish:
docker push $(DOCKER_IMAGE_PREFIX):devel
docker push $(DOCKER_IMAGE_PREFIX):latest
docker push $(DOCKER_IMAGE_PREFIX):binary