Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Build and push deepflow server builder images #5281

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

crazytaxii
Copy link
Contributor

@crazytaxii crazytaxii commented Jan 16, 2024

This PR is for:

  • CI

Provide the server builder image on public registry

Add a new Dockerfile with 2 steps for building server image easily:

$ cat <<EOF > ./server/Dockerfile.ci
FROM deepflowce/deepflow-server-builder:latest AS builder

COPY . /go/deepflow

WORKDIR /go/deepflow/server

RUN make libs/geo/ip_info.go
RUN CGO_ENABLED=0 make server

FROM alpine:latest

RUN apk update && \
    apk upgrade && \
    apk add tzdata

COPY ./server/server.yaml /etc/
RUN mkdir /etc/mysql
COPY ./server/controller/db/mysql/migration/rawsql /etc/mysql
COPY ./server/controller/cloud/filereader/manual_data_samples.yaml /etc/
COPY ./server/querier/db_descriptions /etc/db_descriptions/

COPY --from=builder /go/deepflow/server/bin/deepflow-server /bin/deepflow-server

CMD /bin/deepflow-server
EOF
$ docker build -t deepflowce/deepflow-server:dev -f ./server/Dockerfile.ci .

@Nick-0314
Copy link
Collaborator

@crazytaxii This image should not need to be built every time.You can set it to be built only when files change
这个镜像应该不需要每次都build,可以设置为在文件有改动的时候再build这个镜像

Comment on lines 161 to 162
"registry.cn-beijing.aliyuncs.com/deepflow-ce/${{ env.BUILDER_IMAGE }}:${{ env.IMAGE_TAG_PREFIX }}-${{ env.IMAGE_TAG }}"
"registry.cn-beijing.aliyuncs.com/deepflow-ce/${{ env.BUILDER_IMAGE }}:${{ env.IMAGE_TAG_PREFIX }}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tag应该相对固定,builder镜像不适合每次build的tag都更新,应该有一个好记的tag,比如每次改动这个dockerfile时+1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感觉 latest 就够了

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不同的分支,可能还需要不同的tag

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

用 ${{ env.IMAGE_TAG_PREFIX }} 这个变量应该就可以了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants