Skip to content

Commit

Permalink
adds .devcontainer/environment.yml in .devcontainer/Dockerfile #49
Browse files Browse the repository at this point in the history
  • Loading branch information
mxochicale committed Nov 5, 2023
1 parent f471543 commit 2058c74
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM mcr.microsoft.com/devcontainers/miniconda:0-3

# Copy environment.yml (if found) to a temp location so we update the environment. Also
# copy "noop.txt" so the COPY instruction does not fail if no environment.yml exists.
COPY environment.yml* .devcontainer/noop.txt /tmp/conda-tmp/
COPY .devcontainer/environment.yml* .devcontainer/noop.txt /tmp/conda-tmp/
RUN if [ -f "/tmp/conda-tmp/environment.yml" ]; then umask 0002 && /opt/conda/bin/conda env update -n base -f /tmp/conda-tmp/environment.yml; fi \
&& rm -rf /tmp/conda-tmp

Expand Down
9 changes: 9 additions & 0 deletions .devcontainer/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: default
channels:
- conda-forge
- default
dependencies:
- python==3.9.*
- pip
- pip:
- opencv-python-headless
25 changes: 24 additions & 1 deletion codespaces/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,25 @@
### Create codespaces
1. Select branch
2. Go to Code> create codespace on `branch-name`
3. `New with options`


## predefined dev container configuration

1. Access the Visual Studio Code Command Palette (Shift+Command+P / Ctrl+Shift+P), then start typing "add dev".
Click Codespaces: Add Dev Container Configuration Files.
2. Create a new config file
3. Select container conf template: Miniconda (Python3)
4. Select additional feature `Nothing`


Creates: solid guacamole
In the terminal:
```
conda info
conda env list
```


### Create python
1. `Install enable suggested extensions Python + Jupyter`
Expand All @@ -15,10 +34,14 @@
4. pythonm 3.11






## References
https://www.sckaiser.com/blog/2023/01/30/conda-codespaces.html
https://github.com/crazy4pi314/conda-devcontainer-demo
https://blog.shibayan.jp/entry/20220309/1646754054
https://www.youtube.com/watch?v=RIchFX_gYb0
https://github.com/microsoft/AI-For-Beginners/blob/main/.devcontainer/Dockerfile

* Prebuild configuration: https://github.com/mxochicale/code/settings/codespaces

0 comments on commit 2058c74

Please sign in to comment.