Skip to content

Commit

Permalink
fix Dockerfile context bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zryfish committed Sep 6, 2021
1 parent ed9f5a9 commit 7c880d9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

ARG GOLANG_IMAGE=golang:1.16.5
FROM ${GOLANG_IMAGE} as binary_tools_context
FROM ${GOLANG_IMAGE} as build_context

ENV OUTDIR=/out
RUN mkdir -p ${OUTDIR}/usr/local/bin/
Expand All @@ -9,15 +9,14 @@ WORKDIR /workspace
ADD . /workspace/

RUN make all
RUN mv /workspace/bin/{server,client,kubectl-kn} ${OUTDIR}/usr/local/bin/
RUN mv /workspace/bin/* ${OUTDIR}/usr/local/bin/

##############
# Final image
#############

FROM alpine:3.11

COPY --from=base_os_context /out/ /
COPY --from=build_context /out/ /

WORKDIR /
Expand Down
3 changes: 2 additions & 1 deletion cmd/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ func main() {
clientOptions := app.NewClientOptions()

command := &cobra.Command{
Use: "Kunnel",
Use: "client",
Long: "A tool for tunnel local service.",
RunE: func(cmd *cobra.Command, args []string) error {
local, err := utils.NewLocal(clientOptions.Local)
if err != nil {
Expand Down
3 changes: 2 additions & 1 deletion cmd/kn/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ func main() {
knOptions := app.NewKnOptions()

knCommand := &cobra.Command{
Use: "kn is a kubectl plugin to proxy kubernetes service outside the cluster.",
Use: "kubectl-kn",
Long: "kn is a kubectl plugin to proxy kubernetes service outside the cluster.",
RunE: func(cmd *cobra.Command, args []string) error {
if len(knOptions.Service) == 0 {
return fmt.Errorf("service not provided")
Expand Down

0 comments on commit 7c880d9

Please sign in to comment.