Skip to content

Commit

Permalink
fix: workdir issue
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianKramm committed Sep 7, 2023
1 parent facd0cd commit 7003eed
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/test
/tools
/dist
/dockerless
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ COPY --from=busybox /bin /.dockerless/bin

RUN ["/.dockerless/bin/sh", "-c", "echo 'root:x:0:0:root:/root:/.dockerless/bin/sh' > /etc/passwd && chmod 666 /etc/passwd"]

WORKDIR /.dockerless
WORKDIR /

ENTRYPOINT ["/.dockerless/bin/sh", "-c"]

Expand Down
4 changes: 2 additions & 2 deletions cmd/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func (cmd *BuildCmd) build() (v1.Image, error) {
}

// change dir before building
err = os.Chdir(cmd.Context)
err = os.Chdir("/")
if err != nil {
return nil, fmt.Errorf("change dir: %w", err)
}
Expand Down Expand Up @@ -161,7 +161,7 @@ func (cmd *BuildCmd) build() (v1.Image, error) {
if err != nil {
// add a passwd as other we won't be able to exec into this container
if addPwdErr := addPasswd(); addPwdErr != nil {
return nil, fmt.Errorf("build and add passwd error occurred: %w --- %w", err, addPwdErr)
return nil, fmt.Errorf("build and add passwd error occurred: %w --- %v", err, addPwdErr)
}

return nil, fmt.Errorf("build error: %w", err)
Expand Down

0 comments on commit 7003eed

Please sign in to comment.