1 Star 0 Fork 22

sunhacker / Bytebase

forked from Gitee 极速下载 / Bytebase 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Dockerfile.bb 1.46 KB
一键复制 编辑 原始数据 按行查看 历史
# DO NOT run docker build against this file directly. Instead using ./build_docker_bb.sh as that
# one sets the various ARG used in the Dockerfile
# After build
# $ docker run --init --rm --name bb bytebase/bb
FROM golang:1.18.4 as bb
ARG VERSION="development"
ARG GO_VERSION="1.18.4"
ARG GIT_COMMIT="unknown"
ARG BUILD_TIME="unknown"
ARG BUILD_USER="unknown"
WORKDIR /bb-build
COPY . .
# -ldflags="-w -s" means omit DWARF symbol table and the symbol table and debug information
RUN GOOS=linux GOARCH=amd64 go build \
--tags "release" \
-ldflags="-w -s -X 'github.com/bytebase/bytebase/bin/bb/cmd.version=${VERSION}' -X 'github.com/bytebase/bytebase/bin/bb/cmd.goversion=${GO_VERSION}' -X 'github.com/bytebase/bytebase/bin/bb/cmd.gitcommit=${GIT_COMMIT}' -X 'github.com/bytebase/bytebase/bin/bb/cmd.buildtime=${BUILD_TIME}' -X 'github.com/bytebase/bytebase/bin/bb/cmd.builduser=${BUILD_USER}'" \
-o bb \
./bin/bb/main.go
# Use debian because mysql requires glibc.
FROM debian:bullseye-slim as monolithic
ARG VERSION="development"
ARG GIT_COMMIT="unknown"
ARG BUILD_TIME="unknown"
ARG BUILD_USER="unknown"
# See https://github.com/opencontainers/image-spec/blob/master/annotations.md
LABEL org.opencontainers.image.version=${VERSION}
LABEL org.opencontainers.image.revision=${GIT_COMMIT}
LABEL org.opencontainers.image.created=${BUILD_TIME}
LABEL org.opencontainers.image.authors=${BUILD_USER}
COPY --from=bb /bb-build/bb /usr/local/bin/
CMD ["version"]
ENTRYPOINT ["bb"]
1
https://gitee.com/sunhacker/Bytebase.git
git@gitee.com:sunhacker/Bytebase.git
sunhacker
Bytebase
Bytebase
main

搜索帮助