diff --git a/.gitignore b/.gitignore index b4a511b..30d7e91 100644 --- a/.gitignore +++ b/.gitignore @@ -25,4 +25,4 @@ _testmain.go *.prof /vendor -main \ No newline at end of file +#main diff --git a/Dockerfile b/Dockerfile index 6b9994b..e3d3078 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,13 @@ -FROM golang:alpine AS build - -WORKDIR /go/src/github.com/yumc.pw/cloud/html2pic -ADD . . -RUN go build -o main - -FROM alpine:edge +FROM centos LABEL maintainer="MiaoWoo" ENV LANG C.UTF-8 WORKDIR /root -RUN apk add --no-cache ca-certificates +RUN yum install -y fontconfig -COPY --from=build /go/src/github.com/yumc.pw/cloud/html2pic/main ./main -ADD lib /root/lib +ADD main main +ADD lib lib -CMD ./main -lib /root/lib +ENV LIB_DIR=/root/lib + +CMD ./main -lib ${LIB_DIR} diff --git a/main b/main new file mode 100755 index 0000000..b9fa09f Binary files /dev/null and b/main differ