Skip to content

Commit

Permalink
Put the manager binary into /, instead of /root/
Browse files Browse the repository at this point in the history
/root/ encourages use of the root user, and / is more the pattern I've
seen for thin containers.
  • Loading branch information
justinsb committed Nov 29, 2018
1 parent c6067b0 commit e87227a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/scaffold/manager/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ spec:
spec:
containers:
- command:
- /root/manager
- /manager
image: {{ .Image }}
imagePullPolicy: Always
name: manager
Expand Down
4 changes: 2 additions & 2 deletions pkg/scaffold/manager/dockerfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager {{ .Repo }}/cmd
# Copy the controller-manager into a thin image
FROM ubuntu:latest
WORKDIR /root/
WORKDIR /
COPY --from=builder /go/src/{{ .Repo }}/manager .
ENTRYPOINT ["./manager"]
ENTRYPOINT ["/manager"]
`
4 changes: 2 additions & 2 deletions test/project/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager sigs.k8s.io/kub

# Copy the controller-manager into a thin image
FROM ubuntu:latest
WORKDIR /root/
WORKDIR /
COPY --from=builder /go/src/sigs.k8s.io/kubebuilder/test/project/manager .
ENTRYPOINT ["./manager"]
ENTRYPOINT ["/manager"]
2 changes: 1 addition & 1 deletion test/project/config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ spec:
spec:
containers:
- command:
- /root/manager
- /manager
image: controller:latest
imagePullPolicy: Always
name: manager
Expand Down

0 comments on commit e87227a

Please sign in to comment.