| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 4705126 commit 8b08566
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1188,19 +1188,52 @@ select the option ``Open in VS Code``. You will still be working on the remote | |||
| 1188 | 1188 | codespace instance, thus using the remote instance's compute power. The compute | |
| 1189 | 1189 | power may be a much higher spec than your local machine which can be helpful. | |
| 1190 | 1190 | ||
| 1191 | + .. _devcontainer-directly: | ||
| 1191 | 1192 | ||
| 1192 | - Building the container locally | ||
| 1193 | - ------------------------------ | ||
| 1193 | + Using the dev container directly | ||
| 1194 | + ================================ | ||
| 1194 | 1195 | ||
| 1195 | 1196 | If you want more control over the environment, or to work offline, | |
| 1196 | - you can build the container locally. | ||
| 1197 | + you can use the same container used in | ||
| 1198 | + :ref:`GitHub Codespaces <using-codespaces>` directly. | ||
| 1197 | 1199 | This is meant for users who have (or want to get) some experience | |
| 1198 | 1200 | with containers. | |
| 1199 | - The following instructions are a starting point for | ||
| 1200 | - your own customizations. | ||
| 1201 | - They assume a Unix-like environment, and Docker or Podman installed. | ||
| 1201 | + These instructions assume a Unix-like environment with | ||
| 1202 | + `Docker <https://www.docker.com/>`__ or `Podman <https://podman.io/>`__ | ||
| 1203 | + installed. | ||
| 1202 | 1204 | ||
| 1203 | - In a clone of the `cpython-devcontainers repo <https://github.com/python/cpython-devcontainers>`_, | ||
| 1205 | + .. _devcontainer-image: | ||
| 1206 | + | ||
| 1207 | + Using the pre-built container image | ||
| 1208 | + ----------------------------------- | ||
| 1209 | + | ||
| 1210 | + `Dev container images <https://github.com/python/cpython-devcontainers/pkgs/container/devcontainer>`__ | ||
| 1211 | + are available from the | ||
| 1212 | + `GitHub Container Registry (GHCR) account for the Python org <https://github.com/orgs/python/packages>`__. | ||
| 1213 | + | ||
| 1214 | + To run the container and launch a Bash shell, run one of the following commands | ||
| 1215 | + in a clone of the CPython repository. | ||
| 1216 | + | ||
| 1217 | + .. code-block:: bash | ||
| 1218 | + | ||
| 1219 | + docker run -it --rm --volume $PWD:/workspace --workdir /workspace ghcr.io/python/devcontainer:latest | ||
| 1220 | + | ||
| 1221 | + .. code-block:: bash | ||
| 1222 | + | ||
| 1223 | + podman run -it --rm --volume $PWD:/workspace:Z --workdir /workspace ghcr.io/python/devcontainer:latest | ||
| 1224 | + | ||
| 1225 | + Note that the container has read/write access to the working directory. | ||
| 1226 | + You may want to use a separate clone of CPython, or run ``make clean`` | ||
| 1227 | + to remove caches and build output generated for your host OS. | ||
| 1228 | + | ||
| 1229 | + .. _building-the-container-locally | ||
| 1230 | + .. _devcontainer-build: | ||
| 1231 | + | ||
| 1232 | + Building yourself | ||
| 1233 | + ----------------- | ||
| 1234 | + | ||
| 1235 | + If you prefer, you can build the container image yourself. In a clone of the | ||
| 1236 | + `cpython-devcontainers repo <https://github.com/python/cpython-devcontainers>`_, | ||
| 1204 | 1237 | build the container and name it ``cpython-dev``: | |
| 1205 | 1238 | ||
| 1206 | 1239 | .. code-block:: bash | |
@@ -1213,8 +1246,8 @@ The same command will update any existing ``cpython-dev`` container. | |||
| 1213 | 1246 | Run it again from time to time -- especially if the container stops | |
| 1214 | 1247 | working for you. | |
| 1215 | 1248 | ||
| 1216 | - To run the container, run one of the following commands in a clone of the | ||
| 1217 | - CPython repository. | ||
| 1249 | + To run the container and launch a Bash shell, run one of the following commands | ||
| 1250 | + in a clone of the CPython repository. | ||
| 1218 | 1251 | ||
| 1219 | 1252 | .. code-block:: bash | |
| 1220 | 1253 | ||
@@ -1224,12 +1257,10 @@ CPython repository. | |||
| 1224 | 1257 | ||
| 1225 | 1258 | podman run -it --rm --volume $PWD:/workspace:Z --workdir /workspace cpython-dev | |
| 1226 | 1259 | ||
| 1227 | - Note that the container has read/write access to the working directory. | ||
| 1228 | - You may want to use a separate clone of CPython, or run ``make clean`` | ||
| 1229 | - to remove caches and build output generated for your host OS. | ||
| 1260 | + The same caveats outlined above when running from a container image from GHCR | ||
| 1261 | + also apply here. | ||
| 1230 | 1262 | ||
| 1231 | 1263 | .. c_codespaces_end | |
| 1232 | 1264 | ||
| 1233 | 1265 | ||
| 1234 | - | ||
| 1235 | 1266 | .. include:: ../links.rst | |
| Back | FazBrowse Home | New Git URL |
0 commit comments