mirror of
				https://github.com/NVIDIA/nvidia-container-toolkit
				synced 2025-06-26 18:18:24 +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 \
 | 
			
		||||
		-e GOCACHE=/tmp/.cache \
 | 
			
		||||
		-e GOLANGCI_LINT_CACHE=/tmp/.cache \
 | 
			
		||||
		-v $(PWD):$(PWD) \
 | 
			
		||||
		-w $(PWD) \
 | 
			
		||||
		-v $(PWD):/work \
 | 
			
		||||
		-w /work \
 | 
			
		||||
		--user $$(id -u):$$(id -g) \
 | 
			
		||||
		$(BUILDIMAGE) \
 | 
			
		||||
			make $(*)
 | 
			
		||||
@ -134,7 +134,7 @@ PHONY: .shell
 | 
			
		||||
		-ti \
 | 
			
		||||
		-e GOCACHE=/tmp/.cache \
 | 
			
		||||
		-e GOLANGCI_LINT_CACHE=/tmp/.cache \
 | 
			
		||||
		-v $(PWD):$(PWD) \
 | 
			
		||||
		-w $(PWD) \
 | 
			
		||||
		-v $(PWD):/work \
 | 
			
		||||
		-w /work \
 | 
			
		||||
		--user $$(id -u):$$(id -g) \
 | 
			
		||||
		$(BUILDIMAGE)
 | 
			
		||||
 | 
			
		||||
@ -20,4 +20,8 @@ RUN go install github.com/matryer/moq@latest
 | 
			
		||||
RUN go install github.com/gordonklaus/ineffassign@d2c82e48359b033cde9cf1307f6d5550b8d61321
 | 
			
		||||
RUN go install github.com/client9/misspell/cmd/misspell@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