You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`DOCKER_ENV`| true | Only available inside a dev env container |
64
+
|`DOCKER_ENV_NAME`| Name of the current service | Only available when running an interactive shell inside a dev env container |
65
+
|`DOCKER_ENV_PROJECT_BASE_COMPOSE_FILE`|`$DOCKER_ENV_PROJECT_CACHE_DIRECTORY/base.compose.yaml`| Generated base compose file that **must** be extended by your dev-env service(s) in `$DOCKER_ENV_PROJECT_COMPOSE_FILE`|
66
+
67
+
<!-- markdownlint-enable MD013 -->
68
+
27
69
### Recommendations
28
70
71
+
### Add .cache directory to .gitignore
72
+
73
+
`docker-env` stores a generated base compose.yaml file for your project in `.cache/docker-env`.
74
+
This file should not be commited as it may contain user-specific paths.
75
+
29
76
#### Alias
30
77
31
78
You should create an alias for `./docker/env.sh` as it's going to be tedious to type it all the
@@ -46,39 +93,35 @@ export DOCKER_ENV_REGISTRY="ghcr.io/<FOO>" # or any other container registry
46
93
47
94
#### Local development
48
95
49
-
Assuming your Docker daemon is running:
96
+
Assuming your Docker daemon is running, just run `./docker/env.sh shell` to build/pull images,
97
+
create containers, start them and open an interactive shell in the dev env container.
50
98
51
-
1.`./docker/env.sh init` To pull and/or build the image and create host files.
52
-
2.`./docker/env.sh up` To create and start a dev container.
53
-
3.`./docker/env.sh shell` To open a shell inside the running dev container.
54
-
4. Develop (optionally, attach your editor/IDE to the running dev container).
55
-
5.`exit` to close the shell and return to the host computer.
56
-
6.`./docker/env.sh down` To stop and remove the running dev container.
99
+
> Again, customizing the `$HOME/.config/docker-env/compose.yaml` file will allow you to mount
100
+
> your personal configurations in the container for a more familiar environment.
57
101
58
-
> Again, using a `$HOME/.config/docker-env/compose.yaml` file will allow you to mount your
59
-
> personal configurations in the container for a more familiar environment.
102
+
#### CI workflows
60
103
61
-
#### CI/CD
104
+
You can use `./docker/env.sh exec -- COMMAND` to build/pull images, create containers, start
105
+
them and execute a command in the dev env container. The `init` and `build` subcommands,
106
+
alongside some [environment variables](#environment-variables) can also be used to
107
+
build/pull/push/tag dev env images.
62
108
63
-
1.`./docker/env.sh init` To pull and/or build the image and host files.
64
-
2.`./docker/env.sh up` To create and start a dev container.
65
-
3.`./docker/env.sh exec COMMAND` To run a command inside the dev container (like running
66
-
tests).
67
-
4.`./docker/env.sh down` To stop and remove the running dev container.
109
+
> You can look at this repo's CI/CD workflows for inspiration
68
110
69
-
> You can also use the `tag`, `push` and `pull` subcommands to manage your dev image registry
70
-
> versioning.
111
+
#### Winding down
112
+
113
+
When done, you can stop and remove the environment using `./docker/env.sh down`
0 commit comments