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

Duplicate WORKDIR at Dockerfile #5634

Closed
1 task done
ajutamangdev opened this issue Sep 15, 2024 · 0 comments · Fixed by #5635
Closed
1 task done

Duplicate WORKDIR at Dockerfile #5634

ajutamangdev opened this issue Sep 15, 2024 · 0 comments · Fixed by #5635
Assignees
Labels
Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Milestone

Comments

@ajutamangdev
Copy link

ajutamangdev commented Sep 15, 2024

Is there an existing issue for this?

  • I have searched the existing issues.

Current Behavior

# Build
FROM golang:1.21-alpine AS build-env
RUN apk add build-base
WORKDIR /app
COPY . /app
WORKDIR /app # duplicated app WORKDIR here
RUN go mod download
RUN go build ./cmd/nuclei

# Release
FROM alpine:3.18.6
RUN apk upgrade --no-cache \
    && apk add --no-cache bind-tools chromium ca-certificates
COPY --from=build-env /app/nuclei /usr/local/bin/

ENTRYPOINT ["nuclei"]

Expected Behavior

# Build
FROM golang:1.21-alpine AS build-env
RUN apk add build-base
WORKDIR /app
COPY . /app
RUN go mod download
RUN go build ./cmd/nuclei

# Release
FROM alpine:3.18.6
RUN apk upgrade --no-cache \
    && apk add --no-cache bind-tools chromium ca-certificates
COPY --from=build-env /app/nuclei /usr/local/bin/

ENTRYPOINT ["nuclei"]

Steps To Reproduce

  • Build the docker image locally
  • docker build -t nuclei .
  • Logs will showcase the duplicate work directory

Relevant log output

=> CACHED [build-env 2/7] RUN apk add build-base                                                                                              0.0s
 => CACHED [build-env 3/7] WORKDIR /app                                                                                                        0.0s
 => CACHED [build-env 4/7] COPY . /app                                                                                                         0.0s
 => CACHED [build-env 5/7] WORKDIR /app                                                                                                        0.0s
 => CACHED [build-env 6/7] RUN go mod download                                                                                                 0.0s
 => CACHED [build-env 7/7] RUN go build ./cmd/nuclei    

Environment

OS: Ubuntu 24.04.1 LTS
@ajutamangdev ajutamangdev added the Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. label Sep 15, 2024
@dogancanbakir dogancanbakir self-assigned this Sep 15, 2024
@ehsandeep ehsandeep added this to the nuclei v3.3.3 milestone Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants