Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛(docker) use local user ID in the dev image #316

Merged
merged 1 commit into from
Jul 26, 2018
Merged

Conversation

jmaupetit
Copy link
Contributor

@jmaupetit jmaupetit commented Jul 26, 2018

Purpose

When starting the development stack using the docker-compose up command, compose uses the image default USER to run defined command (e.g. 10000 in the "dev" Dockerfile). Hence the Django development server runs using this user ID. This is an issue when developing with local volumes mounted in this container, because, the server may want to create new files in these volumes and unfortunately the running user (with UID 10000) has no permission to write in the aforementioned volumes.

Proposal

  • Add a UID build ARG to be able to customize the default user ID in the "dev" docker image

Fix #305

@jmaupetit jmaupetit added needs review bug FUN Team Tasks that need to be undertaken by a member of the FUN team. labels Jul 26, 2018
@jmaupetit jmaupetit self-assigned this Jul 26, 2018
Richie's development image can now be built using a user ID passed as a
build argument. This allows us to run commands with this default user
when starting the docker-compose app service and prevent permission
issues with mounted volumes belonging to the local user.

Fix #305
# passing a build argument to your build command, e.g.:
# passing the BASE_TAG build argument to your build command. You can also
# override the default container running user ID (e.g. 1000) thanks to the UID
# build argument (we recommend using yours). An example follows:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be called USER (or USER_ID)? Not sure UID is explicit and the param in Dockerfile is called USER.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It refers to the UID shell variable. I thought it was explicit...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok then

@jmaupetit jmaupetit merged commit 61eeb0b into master Jul 26, 2018
@jmaupetit jmaupetit deleted the fix-compose-user branch July 26, 2018 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug FUN Team Tasks that need to be undertaken by a member of the FUN team. needs review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants