-
Notifications
You must be signed in to change notification settings - Fork 23
Add user to generated docker image #35
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,7 +142,15 @@ If you want to build the docker image yourself, use the following command: | |
|
||
This script will define the desired versions of the components and build the Docker as described in the `Dockerfile`. | ||
|
||
Pre-built docker images are also available on [docker hub](https://hub.docker.com/repository/docker/scssubstratee/substratee_dev/tags). | ||
It also adds the current user to the docker. The docker will start by default with the `USER_ID` and `GROUP_ID` that executed the build afterwards. This takes care of permission issues on docker generated/modified files and it allows seamless editing on the host while building and running in the docker. | ||
|
||
The following command mounts the current directory into docker and publishes the default ports of the binaries to the host: | ||
|
||
``` | ||
docker run -it --mount "type=bind,src=$(pwd),dst=/opt/shared" --workdir /opt/shared -p 9979:9944 -p 2079:2000 -p 3079:3443 scssubstratee/substratee_dev:1804-2.12-1.1.3-001-user-1000-group-1000 /bin/bash | ||
``` | ||
|
||
Pre-built docker images are also available on [docker hub](https://hub.docker.com/repository/docker/scssubstratee/substratee_dev/tags). **Note:** The pre-built images will always run as root. Any files generated withing docker can only be changed with root access. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the last sentence is not correct. Please have a look at the cleanup section on howto_private_tx on substratee.com There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah ups. I have never seen this section. What about files that are modified by both, like the Cargo.lock? And after subsequent builds. Do we need to return the ownership after every build inside the docker? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you just need to return ownership before exiting the docker container. root can anyhow write your (local) files There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes I see that, but my scenario is that I am developping while running the container. |
||
|
||
## Demo | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the name of the docker image may be wrong. your user and group can have a different guid