update
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
FROM golang:1.19.7-alpine as builder
|
FROM golang:1.19.7-alpine as builder
|
||||||
LABEL anther="github.com/Sakurasan"
|
LABEL anther="github.com/Sakurasan"
|
||||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && apk update && apk --no-cache add openssl make cmake upx
|
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && apk --no-cache add make cmake upx
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
COPY . /build
|
COPY . /build
|
||||||
ENV GO111MODULE=on
|
ENV GO111MODULE=on
|
||||||
@@ -12,9 +12,10 @@ FROM alpine:latest AS runner
|
|||||||
# 设置alpine 时间为上海时间
|
# 设置alpine 时间为上海时间
|
||||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && apk update && apk --no-cache add tzdata && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
|
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && apk update && apk --no-cache add tzdata && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
|
||||||
&& echo "Asia/Shanghai" > /etc/timezone \
|
&& echo "Asia/Shanghai" > /etc/timezone \
|
||||||
&& apk del tzdata && export GIN_MODE=release
|
&& export PATH=$PATH:/app
|
||||||
# RUN apk update && apk --no-cache add openssl libgcc libstdc++ binutils
|
# RUN apk update && apk --no-cache add openssl libgcc libstdc++ binutils
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=builder /build/bin/opencatd /app/opencatd
|
COPY --from=builder /build/bin/opencatd /app/opencatd
|
||||||
|
ENV GIN_MODE=release
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
ENTRYPOINT ["/app/opencatd"]
|
ENTRYPOINT ["/app/opencatd"]
|
||||||
5
makefile
5
makefile
@@ -24,11 +24,12 @@ build:
|
|||||||
upx -9 bin/opencatd
|
upx -9 bin/opencatd
|
||||||
|
|
||||||
.PHONY:docker
|
.PHONY:docker
|
||||||
|
# build docker images
|
||||||
docker:
|
docker:
|
||||||
docker run --privileged --rm tonistiigi/binfmt --install all
|
docker run --privileged --rm tonistiigi/binfmt --install all
|
||||||
docker buildx create --use --name xbuilder
|
docker buildx create --use --name xbuilder --driver docker-container
|
||||||
docker buildx inspect xbuilder --bootstrap
|
docker buildx inspect xbuilder --bootstrap
|
||||||
docker buildx build --platform linux/amd64,linux/arm64 -t mirrors2/opencatd:latest . --push
|
docker buildx build --platform linux/amd64,linux/arm64 -t mirrors2/opencatd:latest -f docker/Dockerfile . --push
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
# clean
|
# clean
|
||||||
|
|||||||
Reference in New Issue
Block a user