Comments (1)
Hi @erwin
I'm so sorry for the long response. It looks like I missed your issue.
I like your proposal. It seems we can pass a --user
option https://docs.docker.com/engine/reference/commandline/compose_run/
So we can try to implement something like the following:
# dip.yml
interaction:
cmd:
service: backend
command: foo
run_as_me: true
where run_as_me
will be converted into docker compose run --user $(id -u):$(id -g)
We should be careful because I don't have the problem with permissions on Docker for Mac, so maybe we should skip this option.
Update: after writing the text above, I realized that it won't work with dip compose up some-service
.
I found an interesting post https://medium.com/redbubble/running-a-docker-container-as-a-non-root-user-7d2e00f8ee15
So, we can add a separate docker-compose.linux.yml
https://github.com/bibendi/dip#dip_os with:
services:
app:
user: ${DIP_CURRENT_USER}
add it to a dip.yml
compose:
files:
- docker-compose.yml
- docker-compose.${DIP_OS}.yml
and implement DIP_CURRENT_USER
here
Lines 53 to 57 in f13cd6f
or you can add it to your ~/.zshrc
DIP_CURRENT_USER=$(id -u):$(id -g)
from dip.
Related Issues (20)
- dip provision fails if there is a space in the path name HOT 2
- Dip does not wrap an actual container command in quotes on Ubuntu HOT 4
- Since 7.1.2 `shell: false` commands with any argument fails with "undefined local variable or method `default_args' " HOT 2
- Docker compose v2 compat? HOT 8
- Question: Is there a way to use the 7+ version for non-ruby project? HOT 1
- question regarding description string HOT 1
- port forwardings in docker-compose.yml are not activated via dip HOT 2
- Can I use more than one provision or there have another way to run commands each by each? HOT 4
- `dip nginx` Default Image Change to `nginxproxy/nginx-proxy` HOT 1
- Doesn't work on MacOS Catalina HOT 3
- `docker-compose` is always used instead of `docker compose` HOT 2
- Latest version doesnt recognize the commands
- Feature request: DIP_ROOT_DIR env var
- Question: Is it possible to use Docker Compose profiles? HOT 3
- Make DIP_FILE relative path
- dip commands fails with psych error 'Tried to load unspecified class: Symbol (Psych::DisallowedClass)' HOT 4
- Feature request: Ability to remove environment HOT 1
- Current Docker host user UID special environment variable HOT 2
- replace nginx with traefik HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dip.