Skip to content

Commit 35050c7

Browse files
authored
Added documentation about user and group ID
This enables to create code files as the current user.
1 parent bbb7338 commit 35050c7

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

README.md

+14-3
Original file line numberDiff line numberDiff line change
@@ -132,19 +132,30 @@ Whenever you make changes to your data model definitions or update the code
132132
generators and/or skeleton server projects `graphql-server` or
133133
`single-page-app`, you should repeat the following code generation.
134134

135+
#### Create files as current user
136+
137+
To generate code files from within a Docker container into which external host
138+
folders are mounted, you need to start the respective Docker container as the
139+
yourself.
140+
141+
First, find out your user and your group identifiers by running `id` in a terminal.
142+
Remember your user ID (`uid`) and your group ID (`gid`).
143+
135144
#### Generate the GraphQL server
136145

137146
```
138-
docker run --rm -it -v `pwd`:/opt --user 1000:1000 sciencedb-code-generators:latest
139-
graphql-server-model-codegen generate --jsonFiles /opt/data_model_definitions -o /opt/graphql-server
147+
docker run --rm -it -v `pwd`:/opt --user <your_uid>:<your_gid> sciencedb-code-generators:latest
148+
graphql-server-model-codegen --jsonFiles /opt/data_model_definitions -o /opt/graphql-server
140149
```
150+
where `<your_uid>` and `<your_gid>` are your user ID and your group ID, respectively.
141151

142152
#### Generate the Single Page Application (SPA) server
143153

144154
```
145-
docker run --rm -it -v `pwd`:/opt --user 1000:1000 sciencedb-code-generators:latest
155+
docker run --rm -it -v `pwd`:/opt --user <your_uid>:<your_gid> sciencedb-code-generators:latest
146156
single-page-app-codegen --jsonFiles /opt/data_model_definitions -o /opt/single-page-app
147157
```
158+
where `<your_uid>` and `<your_gid>` are your user ID and your group ID, respectively.
148159

149160
### Multiple code generation
150161

0 commit comments

Comments
 (0)