Skip to content

Commit

Permalink
Allow codegen to run as non-root user in the Docker container (argopr…
Browse files Browse the repository at this point in the history
  • Loading branch information
jannfis authored and alexec committed Jul 26, 2019
1 parent 5e4f327 commit 351e964
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ codegen-local: protogen clientgen openapigen manifests

.PHONY: codegen
codegen: dev-tools-image
docker run --rm -it -v ${CURRENT_DIR}:/go/src/github.com/argoproj/argo-cd -w /go/src/github.com/argoproj/argo-cd argocd-dev-tools bash -c "GOPATH=/go make codegen-local"
docker run --rm -it -u $(shell id -u) -e HOME=/home/user -v ${CURRENT_DIR}:/go/src/github.com/argoproj/argo-cd -w /go/src/github.com/argoproj/argo-cd argocd-dev-tools bash -c "GOPATH=/go make codegen-local"

.PHONY: cli
cli: clean-debug
Expand Down
5 changes: 4 additions & 1 deletion hack/Dockerfile.dev-tools
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ RUN wget https://storage.googleapis.com/kubernetes-helm/helm-v${HELM_VERSION}-li
mv /tmp/linux-amd64/helm /usr/local/bin/helm && \
helm version --client

RUN helm init --client-only
RUN mkdir -p /home/user && chmod 777 /home/user
RUN HELM_HOME=/home/user/.helm helm init --client-only

RUN apt-get update && apt-get install -y \
zip && \
Expand All @@ -55,3 +56,5 @@ RUN curl -sLf -C - -o /tmp/jq https://github.com/stedolan/jq/releases/download/j
cp /tmp/jq /usr/local/bin/jq && \
chmod +x /usr/local/bin/jq && \
jq --version

RUN mkdir -p /go/pkg && chmod 777 /go/pkg

0 comments on commit 351e964

Please sign in to comment.