mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2024-11-23 20:53:30 +00:00
Ensure git works in container
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
c5a9ed6594
commit
b8b134f389
8
Makefile
8
Makefile
@ -120,8 +120,8 @@ $(DOCKER_TARGETS): docker-%: .build-image
|
|||||||
--rm \
|
--rm \
|
||||||
-e GOCACHE=/tmp/.cache \
|
-e GOCACHE=/tmp/.cache \
|
||||||
-e GOLANGCI_LINT_CACHE=/tmp/.cache \
|
-e GOLANGCI_LINT_CACHE=/tmp/.cache \
|
||||||
-v $(PWD):$(PWD) \
|
-v $(PWD):/work \
|
||||||
-w $(PWD) \
|
-w /work \
|
||||||
--user $$(id -u):$$(id -g) \
|
--user $$(id -u):$$(id -g) \
|
||||||
$(BUILDIMAGE) \
|
$(BUILDIMAGE) \
|
||||||
make $(*)
|
make $(*)
|
||||||
@ -134,7 +134,7 @@ PHONY: .shell
|
|||||||
-ti \
|
-ti \
|
||||||
-e GOCACHE=/tmp/.cache \
|
-e GOCACHE=/tmp/.cache \
|
||||||
-e GOLANGCI_LINT_CACHE=/tmp/.cache \
|
-e GOLANGCI_LINT_CACHE=/tmp/.cache \
|
||||||
-v $(PWD):$(PWD) \
|
-v $(PWD):/work \
|
||||||
-w $(PWD) \
|
-w /work \
|
||||||
--user $$(id -u):$$(id -g) \
|
--user $$(id -u):$$(id -g) \
|
||||||
$(BUILDIMAGE)
|
$(BUILDIMAGE)
|
||||||
|
@ -21,3 +21,7 @@ RUN go install github.com/gordonklaus/ineffassign@d2c82e48359b033cde9cf1307f6d55
|
|||||||
RUN go install github.com/client9/misspell/cmd/misspell@latest
|
RUN go install github.com/client9/misspell/cmd/misspell@latest
|
||||||
RUN go install github.com/google/go-licenses@latest
|
RUN go install github.com/google/go-licenses@latest
|
||||||
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCI_LINT_VERSION}
|
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCI_LINT_VERSION}
|
||||||
|
|
||||||
|
# We need to set the /work directory as a safe directory.
|
||||||
|
# This allows git commands to run in the container.
|
||||||
|
RUN git config --file=/.gitconfig --add safe.directory /work
|
||||||
|
Loading…
Reference in New Issue
Block a user