Skip to content

Commit 6037f92

Browse files
committed
correct param descriptions
1 parent 73fd80d commit 6037f92

File tree

3 files changed

+9
-90
lines changed

3 files changed

+9
-90
lines changed

README.md

Lines changed: 5 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# My devcontainer features
22

3+
My devcontainer features using the [feature-starter](https://github.com/devcontainers/feature-starter) template.
34

4-
## `magircmirror`
5+
## `magicmirror`
56

67
Automatically setup package manager mirrors, including ubuntu, pypi and apk etc.
78

@@ -10,91 +11,9 @@ Automatically setup package manager mirrors, including ubuntu, pypi and apk etc.
1011
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
1112
"features": {
1213
"ghcr.io/sidecus/devcontainer-features/magicmirror:1": {
13-
"pypi_mirror": "https://mirrors.bfsu.edu.cn/pypi/web/simple/",
14-
"ubuntu_mirror": "mirrors.bfsu.edu.cn",
15-
"apk_mirror": "mirrors.tuna.tsinghua.edu.cn"
16-
}
17-
}
18-
}
19-
```
20-
21-
## Distributing Features
22-
23-
### Versioning
24-
25-
Features are individually versioned by the `version` attribute in a Feature's `devcontainer-feature.json`. Features are versioned according to the semver specification. More details can be found in [the dev container Feature specification](https://containers.dev/implementors/features/#versioning).
26-
27-
### Publishing
28-
29-
> NOTE: The Distribution spec can be [found here](https://containers.dev/implementors/features-distribution/).
30-
>
31-
> While any registry [implementing the OCI Distribution spec](https://github.com/opencontainers/distribution-spec) can be used, this template will leverage GHCR (GitHub Container Registry) as the backing registry.
32-
33-
Features are meant to be easily sharable units of dev container configuration and installation code.
34-
35-
This repo contains a **GitHub Action** [workflow](.github/workflows/release.yaml) that will publish each Feature to GHCR.
36-
37-
*Allow GitHub Actions to create and approve pull requests* should be enabled in the repository's `Settings > Actions > General > Workflow permissions` for auto generation of `src/<feature>/README.md` per Feature (which merges any existing `src/<feature>/NOTES.md`).
38-
39-
By default, each Feature will be prefixed with the `<owner/<repo>` namespace. For example, the two Features in this repository can be referenced in a `devcontainer.json` with:
40-
41-
```
42-
ghcr.io/devcontainers/feature-starter/color:1
43-
ghcr.io/devcontainers/feature-starter/hello:1
44-
```
45-
46-
The provided GitHub Action will also publish a third "metadata" package with just the namespace, eg: `ghcr.io/devcontainers/feature-starter`. This contains information useful for tools aiding in Feature discovery.
47-
48-
'`devcontainers/feature-starter`' is known as the feature collection namespace.
49-
50-
### Marking Feature Public
51-
52-
Note that by default, GHCR packages are marked as `private`. To stay within the free tier, Features need to be marked as `public`.
53-
54-
This can be done by navigating to the Feature's "package settings" page in GHCR, and setting the visibility to 'public`. The URL may look something like:
55-
56-
```
57-
https://github.com/users/<owner>/packages/container/<repo>%2F<featureName>/settings
58-
```
59-
60-
<img width="669" alt="image" src="https://user-images.githubusercontent.com/23246594/185244705-232cf86a-bd05-43cb-9c25-07b45b3f4b04.png">
61-
62-
### Adding Features to the Index
63-
64-
If you'd like your Features to appear in our [public index](https://containers.dev/features) so that other community members can find them, you can do the following:
65-
66-
* Go to [github.com/devcontainers/devcontainers.github.io](https://github.com/devcontainers/devcontainers.github.io)
67-
* This is the GitHub repo backing the [containers.dev](https://containers.dev/) spec site
68-
* Open a PR to modify the [collection-index.yml](https://github.com/devcontainers/devcontainers.github.io/blob/gh-pages/_data/collection-index.yml) file
69-
70-
This index is from where [supporting tools](https://containers.dev/supporting) like [VS Code Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) and [GitHub Codespaces](https://github.com/features/codespaces) surface Features for their dev container creation UI.
71-
72-
#### Using private Features in Codespaces
73-
74-
For any Features hosted in GHCR that are kept private, the `GITHUB_TOKEN` access token in your environment will need to have `package:read` and `contents:read` for the associated repository.
75-
76-
Many implementing tools use a broadly scoped access token and will work automatically. GitHub Codespaces uses repo-scoped tokens, and therefore you'll need to add the permissions in `devcontainer.json`
77-
78-
An example `devcontainer.json` can be found below.
79-
80-
```jsonc
81-
{
82-
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
83-
"features": {
84-
"ghcr.io/my-org/private-features/hello:1": {
85-
"greeting": "Hello"
86-
}
87-
},
88-
"customizations": {
89-
"codespaces": {
90-
"repositories": {
91-
"my-org/private-features": {
92-
"permissions": {
93-
"packages": "read",
94-
"contents": "read"
95-
}
96-
}
97-
}
14+
"pypi_mirror": "your-pypi-mirror",
15+
"ubuntu_mirror": "your-ubuntu-mirror",
16+
"apk_mirror": "your-alpine-apk-mirror"
9817
}
9918
}
10019
}

src/magicmirror/devcontainer-feature.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"https://mirrors.bfsu.edu.cn/pypi/web/simple/"
1111
],
1212
"default": "",
13-
"description": "Pypi mirror url"
13+
"description": "Python Pypi mirror"
1414
},
1515
"ubuntu_mirror": {
1616
"type": "string",
@@ -26,7 +26,7 @@
2626
"mirrors.tuna.tsinghua.edu.cn"
2727
],
2828
"default": "",
29-
"description": "Ubuntu mirror"
29+
"description": "Alpine apk mirror"
3030
}
3131
},
3232
"installsAfter": [

src/magicmirror/install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ echo "The effective dev container containerUser's home directory is '$_CONTAINER
1818
OS=$(awk -F= '/^NAME/{print $2}' /etc/os-release)
1919
echo "Target OS is ${OS}"
2020

21-
# Ubuntu mirror. TODO[sidecus]: Check this is Ubuntu
21+
# Ubuntu mirror, only run when OS is Ubuntu
2222
UBUNTU_MIRROR=${UBUNTU_MIRROR:-""}
2323
echo "UBUNTU_MIRROR: $UBUNTU_MIRROR"
2424
if [ "${OS}" = '"Ubuntu"' ] && [ -n "${UBUNTU_MIRROR}" ]; then
@@ -38,7 +38,7 @@ if [ -n "${PYPI_MIRROR}" ]; then
3838
echo "index-url = ${PYPI_MIRROR}" >> /etc/pip.conf
3939
fi
4040

41-
# Alpine apk mirror.
41+
# Alpine apk mirror, only run when OS is Alpine
4242
APK_MIRROR=${APK_MIRROR:-""}
4343
echo "APK_MIRROR: $APK_MIRROR"
4444
if [ "${OS}" = '"Alpine Linux"' ] && [ -n "${APK_MIRROR}" ]; then

0 commit comments

Comments
 (0)