-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
76 lines (52 loc) · 2.14 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
IMAGENAME ?= opny/peer-server
BUILDPATH ?= ./build
server/run:
go run cmd/server/main.go
kill-server:
kill -9 $(lsof -t -i tcp:9000)
peerjs/interop/js:
cd interop/js && npm run serve
peerjs/server/run:
docker stop peerjs-server || true
docker run --rm --name peerjs-server -p 9000:9000 -d peerjs/peerjs-server --port 9000 --path /
docker logs -f peerjs-server
docker/run:
docker run --name peer-server -it --rm -p 9000:9000 $(IMAGENAME)
build: build/amd64 build/arm64 build/arm
build/amd64:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ${BUILDPATH}/amd64 .
build/arm64:
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o ${BUILDPATH}/arm64 .
build/arm:
CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 go build -o ${BUILDPATH}/arm7 .
CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build -o ${BUILDPATH}/arm6 .
docker/build: build docker/build/amd64 docker/build/arm64 docker/build/arm
docker/build/manifest:
docker manifest push --purge ${IMAGENAME} || true
docker manifest create \
${IMAGENAME} \
--amend ${IMAGENAME}-amd64 \
--amend ${IMAGENAME}-arm64 \
--amend ${IMAGENAME}-arm6 \
--amend ${IMAGENAME}-arm7
docker manifest annotate ${IMAGENAME} ${IMAGENAME}-amd64 --arch amd64 --os linux
docker manifest annotate ${IMAGENAME} ${IMAGENAME}-arm64 --arch arm64 --os linux
docker manifest annotate ${IMAGENAME} ${IMAGENAME}-arm6 --arch arm --variant v6 --os linux
docker manifest annotate ${IMAGENAME} ${IMAGENAME}-arm7 --arch arm --variant v7 --os linux
docker manifest push ${IMAGENAME}
docker/build/amd64:
docker build . -t ${IMAGENAME}-amd64 --build-arg ARCH=amd64
docker/build/arm64:
docker build . -t ${IMAGENAME}-arm64 --build-arg ARCH=arm64
docker/build/arm:
docker build . -t ${IMAGENAME}-arm6 --build-arg ARCH=arm --build-arg ARM=7
docker build . -t ${IMAGENAME}-arm7 --build-arg ARCH=arm --build-arg ARM=6
docker/push: docker/build docker/push/amd64 docker/push/arm64 docker/push/arm docker/build/manifest
docker manifest push ${IMAGENAME}
docker/push/amd64:
docker push ${IMAGENAME}-amd64
docker/push/arm64:
docker push ${IMAGENAME}-arm64
docker/push/arm:
docker push ${IMAGENAME}-arm6
docker push ${IMAGENAME}-arm7