Skip to content
This repository has been archived by the owner on Jan 14, 2020. It is now read-only.

Commit

Permalink
Add :Z to Docker volume mounts for SELinux
Browse files Browse the repository at this point in the history
When running the sample Makefile on a host with SELinux enabled (Fedora
27 in my case), the Docker container is not able to access the files
that are mapped into the container via the volumes. This is due to
SELinux on the host not having the files labeled correctly. Adding
a :Z to the end of the volume mounts will correct this issue. See
https://www.projectatomic.io/blog/2016/03/dwalsh_selinux_containers/
for more details about the :Z and :z options that are available. These
options are silently ignored for hosts that do not have SELinux enabled
(including OS/X).

CAT: #feat
REF: #46
THX: @masneyb
  • Loading branch information
masneyb authored and fsenart committed Dec 7, 2017
1 parent cb82716 commit a9e5c8b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Makefile.example
Expand Up @@ -46,8 +46,8 @@ docker:
-e PACKAGE=$(PACKAGE)\
-e GOPATH=$(GOPATH)\
-e LDFLAGS='$(LDFLAGS)'\
-v $(CURDIR):$(CURDIR)\
$(foreach GP,$(subst :, ,$(GOPATH)),-v $(GP):$(GP))\
-v $(CURDIR):$(CURDIR):Z\
$(foreach GP,$(subst :, ,$(GOPATH)),-v $(GP):$(GP)):Z\
-w $(CURDIR)\
eawsy/aws-lambda-go-shim:latest make -f $(MAKEFILE) all

Expand Down

0 comments on commit a9e5c8b

Please sign in to comment.