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
VS Code see's your .devcontainer file and offers you to "Reopen in Container". If you answer yes it will start the docker container locally on your PC.
Caution
It will fail on a Mac with an M1 or M2 processor
11: Add a docker file you trust
Add a dockerfile in the root of the repo
Ask CoPilot to...
Use ruby:3.2.3-bullseye. Set language to support BOM characters in Liquid. Add default workdir and expose the Jekyll related ports
...This can do it:
FROM ruby:3.2.3-bullseye
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
WORKDIR /app
EXPOSE 4000 35729
Get the current devcontainer.json file out of the way: Create a Universal folder under /.devcontainer and move it here.
From the command palette choose:
"Add Dev Container Configuration Files" >> "Add configuration to workspace" >> "From dockerfile"
In the new devcontainer.json file add the features, customizations and postCreateCommandsections from your old (Universal) devcontainer.json.
Note
COMMIT
From the command palette choose:
"Rebuild and reopen in container"
It works again:
cd docs/
bundle update
bundle exec jekyll serve
Note that the website is again running on your local PC!
...and check you Docker - it's a local container!
Where is the repo then? It's still on your PC's local disk
In VS Code try
echo clone is on PC's local disk > _temp
Browse the file on your local disk. - The repo is mounted into the devcontainer running in Docker.
Note
PUSH
12: From GitHub - add a new codespace on the new container
From codespace menu choose the three dots next to the + - choose "New with options"
If you don't do this, you will get the default which is the one defined by `/.devcontainer/devcontainer.json``
And if that doesn't exist then it falls back to Universal...
13: On you PC - Clone in volume
Same thing as last time in VS Code:
code .
Only this time choose "Clone in volume" instead.
It still runs.
cd docs/
bundle update
bundle exec jekyll serve
So whats the difference?
Try to change the content of `_temp``
echo clone is inside the docker continer > _temp
git remote -vv
0: Prep the repo
Warning
demobranch in successive ordertemplateREADME.mdwith some fairly complex GitHub flavoured MarkDown (Mermaid)1: Open a code space on an empty main branch
Default container is
universal:2Show a few commands:
ls,git,gh,azazdoesn't work2: Modify existing devcontainer
add the
azCLI featureadd four extensions
cspell,markdownlint,markdown-preview-github-styles,phindandcopilotNote
COMMIT
3: Get help!
Add the Live Share extension.
Invite a friend.
Make sure the friend has write access to repo and to terminals
4: Add a Jekyll site
Ask the friend to setup a Jekyll site:
In the terminal run:
Note
COMMIT
Warning
The commit was impersonated by
meeven if it was my friend doing it!5: Optimize the Jekyll site
githubgem as per recommended in theGemfilebundle update bundle exec jekyll serveIt fails! - add the missing gems:
Update and build
bundle update bundle exec jekyll serveIn the
_config.ymlchangeWarning
With the
baseurlset, the root of the website will show a404You must browse the
/devcontainer-demo/folder to see the website.Note
COMMIT
6: Add a workspace shared `.gitconfig``
In the devcontainer add:
Add a
.gitconfigin the rootNote
COMMIT
PUSH
7: Ask your friend to do the right thing!
Disconnect your friend from Live Share
Ask you friend to start a codespace instead
Let your friend hook up to the presentation
Check
README.md)git config --list --show-origin)8: Serve the repo with GitHub pages
Go to pages, add a GitHub Action
Use this workflow... `jekyll-gh-pages.yml`
Note
COMMIT
9: Start the code space in VS Code
From the repo on GitHub - right click the codespace and starte it in VS Code
It still works
Note that the website is now running on your local PC!
10: Clone to local machine and open in VS Code
Warning
This part only works if you have Docker installed on your PC
VS Code see's your
.devcontainerfile and offers you to "Reopen in Container". If you answer yes it will start the docker container locally on your PC.Caution
It will fail on a Mac with an M1 or M2 processor
11: Add a docker file you trust
Add a
dockerfilein the root of the repoAsk CoPilot to...
...This can do it:
Get the current
devcontainer.jsonfile out of the way: Create aUniversalfolder under/.devcontainerand move it here.From the command palette choose:
"Add Dev Container Configuration Files" >> "Add configuration to workspace" >> "From dockerfile"
In the new
devcontainer.jsonfile add thefeatures,customizationsandpostCreateCommandsections from your old (Universal)devcontainer.json.Note
COMMIT
From the command palette choose:
"Rebuild and reopen in container"
It works again:
Note that the website is again running on your local PC!
...and check you Docker - it's a local container!
Where is the repo then? It's still on your PC's local disk
In VS Code try
Browse the file on your local disk. - The repo is mounted into the devcontainer running in Docker.
Note
PUSH
12: From GitHub - add a new codespace on the new container
From codespace menu choose the three dots next to the + - choose "New with options"
If you don't do this, you will get the
defaultwhich is the one defined by `/.devcontainer/devcontainer.json``And if that doesn't exist then it falls back to
Universal...13: On you PC - Clone in volume
Same thing as last time in VS Code:
code .Only this time choose "Clone in volume" instead.
It still runs.
So whats the difference?
Try to change the content of `_temp``