Skip to content

Script to sync gids and uids between host and container

Notifications You must be signed in to change notification settings

Varun-garg/docker-sync-ids

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Script to sync gids and uids between host and container

Steps to use this script:

  1. In docker compose define users and groups you want to sync, and copy host configuration in read only mode.
volumes:
    - /etc/passwd:/etc/passwd.src:ro
    - /etc/group:/etc/group.src:ro
environment:
    - host_users=www-data,mysql
    - host_groups=www-data,mysql,staff
  1. Copy script docker-sync-ids.sh to your container.

Example:

COPY deploy/docker-sync-ids.sh /tmp/docker-sync-ids.sh
RUN chmod a+x /tmp/docker-sync-ids.sh
  1. Run this script before services are launched.
# env setup

/tmp/docker-sync-ids.sh

# launch services

About

Script to sync gids and uids between host and container

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages