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

Dockerfile 构建args参数不生效 #1685

Closed
Tracked by #1805
lian-yang opened this issue Jun 28, 2023 · 5 comments
Closed
Tracked by #1805

Dockerfile 构建args参数不生效 #1685

lian-yang opened this issue Jun 28, 2023 · 5 comments
Assignees
Labels
kind/bug BUG Feedback
Milestone

Comments

@lian-yang
Copy link

Describe the bug
The source code build parameters set during the Dockerfile build do not override the values defined in the Dockerfile's ARG.

What I want is
docker build --build-arg APP_VERSION=1.0.1 -t xxx

Screenshots
image

FROM golang:1.19-alpine AS builder

LABEL stage=gobuilder

ARG APP_VERSION=unknown

ENV CGO_ENABLED 0
ENV GOPROXY https://goproxy.cn,direct

RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
    && apk update --no-cache && apk add --no-cache tzdata

WORKDIR /build

COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
RUN go build -v -ldflags="-w -s -X 'tyskins/cmd.AppVersion=${APP_VERSION}'" -tags=jsoniter -o app .

FROM alpine

COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /usr/share/zoneinfo/Asia/Shanghai /usr/share/zoneinfo/Asia/Shanghai
ENV TZ Asia/Shanghai

WORKDIR /app
COPY --from=builder /app/app /app/app
COPY --from=builder /build/static /app/public

EXPOSE 9000

CMD ["./app", "-c", "conf/config.toml"]

The relevant information:
-Rainbond版本[v5.14.1]
-Kubernetes版本[1.23.10]

@lian-yang lian-yang added the kind/bug BUG Feedback label Jun 28, 2023
@yangkaa yangkaa assigned quyuancheng and unassigned yangkaa Jun 30, 2023
@yangkaa yangkaa added this to the 5.14.3 milestone Jul 13, 2023
@yangkaa yangkaa assigned ZhangSetSail and unassigned quyuancheng Jul 18, 2023
@csa8280
Copy link

csa8280 commented Dec 4, 2023

修复了吗

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Has it been fixed?

@ZhangSetSail
Copy link
Collaborator

近期安排修复

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Repair scheduled in the near future

@ZhangSetSail ZhangSetSail modified the milestones: 5.15.0, 5.16.1 Dec 12, 2023
@yangkaa yangkaa modified the milestones: 5.16.1, 5.17.0 Jan 4, 2024
@DokiDoki1103 DokiDoki1103 mentioned this issue Jan 11, 2024
32 tasks
@DokiDoki1103
Copy link
Collaborator

#1816

@DokiDoki1103 DokiDoki1103 changed the title The ARG parameters for setting up the source code are not effective. Dockerfile 构建args参数不生效 Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug BUG Feedback
Projects
None yet
Development

No branches or pull requests

7 participants