Skip to content

Commit 67eb76b

Browse files
author
张俊杰
committed
添加Makefile docker镜像自动发布
1 parent cd1729f commit 67eb76b

33 files changed

+23
-72
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,3 @@ vendor/
2020
.DS_Store
2121
#IDE
2222
.idea
23-
24-
/config/a.json

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ v2.0|调整项目目录结构&&修复进度条准确性
2929
Docker
3030

3131
```
32-
docker run -p 9102:9102 -v /config/:/root/bin/config registry.cn-shanghai.aliyuncs.com/zhangjunjie6b/mysql2elasticsearch:[镜像版本号]
32+
docker run -p 9102:9102 -v /config/:/root/bin/configs registry.cn-shanghai.aliyuncs.com/zhangjunjie6b/mysql2elasticsearch:last
3333
```
3434

3535
下载对应平台运行,或源码编译安装

build/package/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ FROM alpine:3.14
22
MAINTAINER mysql2elasticsearch <https://github.com/zhangjunjie6b/mysql2elasticsearch>
33
COPY bin /root/bin
44
EXPOSE 9102
5-
WORKDIR /root/bin
5+
WORKDIR /root/bin/cmd/web/
66
RUN chmod 777 ./main_linux64
77
CMD ./main_linux64

build/package/Makefile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
define initdir
2+
@rm -rf ./bin
3+
@mkdir -vp ./bin/web/public/bootstrap-4.6.0-dist/
4+
@cp -r ../../web/public/bootstrap-4.6.0-dist/ ./bin/web/public/bootstrap-4.6.0-dist/
5+
@mkdir -vp ./bin/web/public/views/
6+
@cp -r ../../web/views/ ./bin/web/views/
7+
@mkdir -vp ./bin/configs/
8+
@cp -r ../../web/default/config/ ./bin/configs/
9+
@mkdir -vp ./bin/cmd/web
10+
endef
11+
12+
main: ../../cmd/web/main.go
13+
${initdir}
14+
@go build -o ./bin/cmd/web/main ../../cmd/web/main.go
15+
@GOOS=linux GOARCH=amd64 go build -o ./bin/cmd/web/main_linux64 ../../cmd/web/main.go
16+
17+
.PHONY: image
18+
image :
19+
${initdir}
20+
@GOOS=linux GOARCH=amd64 go build -o ./bin/cmd/web/main_linux64 ../../cmd/web/main.go
21+

build/package/bin/cmd/web/main

23.8 MB
Binary file not shown.
Binary file not shown.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)