Skip to content

Commit

Permalink
Run docker under current user
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhen Li committed Jun 23, 2019
1 parent f815eaa commit f883fd4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion boltkit/server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ def __init__(self, name, service_name, image, auth, bolt_port, http_port, volume
source, target = s.split(":")
volumes[source] = {'bind': target, 'mode': 'rw'}

uid = int(getenv("UID"))
log.info("uid is %r", uid)

def create_container(img):
return self.docker.containers.create(img,
detach=True,
Expand All @@ -101,7 +104,8 @@ def create_container(img):
name=self.fq_name,
network=self.service_name,
ports=ports,
volumes=volumes)
volumes=volumes,
user=uid)

try:
self.container = create_container(self.image)
Expand Down

0 comments on commit f883fd4

Please sign in to comment.