Skip to content

Commit c5ec23c

Browse files
author
navayla77-ctrl
authored
Merge branch 'main' into main
2 parents 1d04448 + b950373 commit c5ec23c

File tree

19 files changed

+889
-102
lines changed

19 files changed

+889
-102
lines changed

.github/workflows/test-all.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
"azure-cli",
1818
"common-utils",
1919
"conda",
20+
"copilot-cli",
2021
"desktop-lite",
2122
"docker-outside-of-docker",
2223
"docker-in-docker",
@@ -70,6 +71,7 @@ jobs:
7071
"azure-cli",
7172
"common-utils",
7273
"conda",
74+
"copilot-cli",
7375
"desktop-lite",
7476
"docker-outside-of-docker",
7577
"docker-in-docker",

.github/workflows/test-pr.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
azure-cli: ./**/azure-cli/**
1818
common-utils: ./**/common-utils/**
1919
conda: ./**/conda/**
20+
copilot-cli: ./**/copilot-cli/**
2021
desktop-lite: ./**/desktop-lite/**
2122
docker-outside-of-docker: ./**/docker-outside-of-docker/**
2223
docker-in-docker: ./**/docker-in-docker/**

src/common-utils/devcontainer-feature.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "common-utils",
3-
"version": "2.5.4",
3+
"version": "2.5.5",
44
"name": "Common Utilities",
55
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/common-utils",
66
"description": "Installs a set of common command line utilities, Oh My Zsh!, and sets up a non-root user.",
@@ -64,6 +64,11 @@
6464
"type": "boolean",
6565
"default": false,
6666
"description": "Add packages from non-free Debian repository? (Debian only)"
67+
},
68+
"installSsl": {
69+
"type": "boolean",
70+
"default": true,
71+
"description": "Install SSL?"
6772
}
6873
}
6974
}

src/common-utils/install.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ USERNAME="${USERNAME:-"automatic"}"
1818
USER_UID="${UID:-"automatic"}"
1919
USER_GID="${GID:-"automatic"}"
2020
ADD_NON_FREE_PACKAGES="${NONFREEPACKAGES:-"false"}"
21+
INSTALL_SSL="${INSTALLSSL:-"true"}"
2122

2223
MARKER_FILE="/usr/local/etc/vscode-dev-containers/common"
2324

src/common-utils/main.sh

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ USERNAME="${USERNAME:-"automatic"}"
1818
USER_UID="${USERUID:-"automatic"}"
1919
USER_GID="${USERGID:-"automatic"}"
2020
ADD_NON_FREE_PACKAGES="${NONFREEPACKAGES:-"false"}"
21+
INSTALL_SSL="${INSTALLSSL:-"true"}"
2122

2223
MARKER_FILE="/usr/local/etc/vscode-dev-containers/common"
2324

@@ -75,25 +76,27 @@ install_debian_packages() {
7576
manpages-dev \
7677
init-system-helpers"
7778

78-
# Include libssl1.1 if available
79-
if [[ ! -z $(apt-cache --names-only search ^libssl1.1$) ]]; then
80-
package_list="${package_list} libssl1.1"
81-
fi
79+
if [ "${INSTALL_SSL}" = "true" ]; then
80+
# Include libssl1.1 if available
81+
if [[ ! -z $(apt-cache --names-only search ^libssl1.1$) ]]; then
82+
package_list="${package_list} libssl1.1"
83+
fi
8284

83-
# Include libssl3 if available
84-
if [[ ! -z $(apt-cache --names-only search ^libssl3$) ]]; then
85-
package_list="${package_list} libssl3"
86-
fi
85+
# Include libssl3 if available
86+
if [[ ! -z $(apt-cache --names-only search ^libssl3$) ]]; then
87+
package_list="${package_list} libssl3"
88+
fi
8789

88-
# Include appropriate version of libssl1.0.x if available
89-
local libssl_package=$(dpkg-query -f '${db:Status-Abbrev}\t${binary:Package}\n' -W 'libssl1\.0\.?' 2>&1 || echo '')
90-
if [ "$(echo "$libssl_package" | grep -o 'libssl1\.0\.[0-9]:' | uniq | sort | wc -l)" -eq 0 ]; then
91-
if [[ ! -z $(apt-cache --names-only search ^libssl1.0.2$) ]]; then
92-
# Debian 9
93-
package_list="${package_list} libssl1.0.2"
94-
elif [[ ! -z $(apt-cache --names-only search ^libssl1.0.0$) ]]; then
95-
# Ubuntu 18.04
96-
package_list="${package_list} libssl1.0.0"
90+
# Include appropriate version of libssl1.0.x if available
91+
local libssl_package=$(dpkg-query -f '${db:Status-Abbrev}\t${binary:Package}\n' -W 'libssl1\.0\.?' 2>&1 || echo '')
92+
if [ "$(echo "$libssl_package" | grep -o 'libssl1\.0\.[0-9]:' | uniq | sort | wc -l)" -eq 0 ]; then
93+
if [[ ! -z $(apt-cache --names-only search ^libssl1.0.2$) ]]; then
94+
# Debian 9
95+
package_list="${package_list} libssl1.0.2"
96+
elif [[ ! -z $(apt-cache --names-only search ^libssl1.0.0$) ]]; then
97+
# Ubuntu 18.04
98+
package_list="${package_list} libssl1.0.0"
99+
fi
97100
fi
98101
fi
99102

@@ -172,7 +175,7 @@ install_redhat_packages() {
172175
else
173176
echo "Unable to find 'tdnf', 'dnf', or 'yum' package manager. Exiting."
174177
exit 1
175-
fi
178+
fi
176179

177180
if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
178181
package_list="${package_list} \
@@ -228,7 +231,7 @@ fi
228231
fi
229232

230233
# Install EPEL repository if needed (required to install 'jq' for CentOS)
231-
if ! ${install_cmd} -q list jq >/dev/null 2>&1; then
234+
if [[ "${ID}" = "centos" ]] && ! rpm -q jq >/dev/null 2>&1; then
232235
${install_cmd} -y install epel-release
233236
remove_epel="true"
234237
fi
@@ -240,11 +243,18 @@ fi
240243
fi
241244

242245
if [ -n "${package_list}" ]; then
243-
${install_cmd} -y install ${package_list}
246+
echo "Packages to verify are installed: ${package_list}"
247+
echo "Running ${install_cmd} install..."
248+
if [ "${install_cmd}" = "dnf" ]; then
249+
${install_cmd} -y install --allowerasing ${package_list}
250+
else
251+
${install_cmd} -y install ${package_list}
252+
fi
244253
fi
245254

246255
# Get to latest versions of all packages
247256
if [ "${UPGRADE_PACKAGES}" = "true" ]; then
257+
echo "Running ${install_cmd} upgrade..."
248258
${install_cmd} upgrade -y
249259
fi
250260

src/copilot-cli/NOTES.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
3+
## OS Support
4+
5+
This Feature should work on recent versions of Debian/Ubuntu-based distributions.
6+
7+
`bash` is required to execute the `install.sh` script.

src/copilot-cli/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
# GitHub Copilot CLI (copilot-cli)
3+
4+
Installs the GitHub Copilot CLI. Auto-detects latest version and installs needed dependencies.
5+
6+
## Example Usage
7+
8+
```json
9+
"features": {
10+
"ghcr.io/devcontainers/features/copilot-cli:1": {}
11+
}
12+
```
13+
14+
## Options
15+
16+
| Options Id | Description | Type | Default Value |
17+
|-----|-----|-----|-----|
18+
| version | Select version of the GitHub Copilot CLI, if not latest. | string | latest |
19+
20+
21+
22+
## OS Support
23+
24+
This Feature should work on recent versions of Debian/Ubuntu-based distributions.
25+
26+
`bash` is required to execute the `install.sh` script.
27+
28+
29+
---
30+
31+
_Note: This file was auto-generated from the [devcontainer-feature.json](https://github.com/devcontainers/features/blob/main/src/copilot-cli/devcontainer-feature.json). Add additional notes to a `NOTES.md`._
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"id": "copilot-cli",
3+
"version": "1.0.0",
4+
"name": "GitHub Copilot CLI",
5+
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/copilot-cli",
6+
"description": "Installs the GitHub Copilot CLI.",
7+
"options": {
8+
"version": {
9+
"type": "string",
10+
"proposals": [
11+
"latest",
12+
"prerelease"
13+
],
14+
"default": "latest",
15+
"description": "Select version of the GitHub Copilot CLI, if not latest."
16+
}
17+
},
18+
"customizations": {
19+
"vscode": {
20+
"settings": {
21+
"github.copilot.chat.codeGeneration.instructions": [
22+
{
23+
"text": "This dev container includes the GitHub Copilot CLI (`copilot`), which is pre-installed and available on the `PATH`."
24+
}
25+
]
26+
}
27+
}
28+
},
29+
"installsAfter": [
30+
"ghcr.io/devcontainers/features/common-utils"
31+
]
32+
}
33+

src/copilot-cli/install.sh

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#!/usr/bin/env bash
2+
#-------------------------------------------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
5+
#-------------------------------------------------------------------------------------------------------------
6+
#
7+
# Docs: https://github.com/devcontainers/features/blob/main/src/copilot-cli/README.md
8+
# Maintainer: The VS Code and Codespaces Teams
9+
10+
CLI_VERSION=${VERSION:-"latest"}
11+
12+
set -e
13+
14+
if [ "$(id -u)" -ne 0 ]; then
15+
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
16+
exit 1
17+
fi
18+
19+
apt_get_update() {
20+
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
21+
echo "Running apt-get update..."
22+
apt-get update -y
23+
fi
24+
}
25+
26+
# Checks if packages are installed and installs them if not
27+
check_packages() {
28+
if ! dpkg -s "$@" > /dev/null 2>&1; then
29+
apt_get_update
30+
apt-get -y install --no-install-recommends "$@"
31+
fi
32+
}
33+
34+
download_from_github() {
35+
local release_url=$1
36+
echo "Downloading GitHub Copilot CLI from ${release_url}..."
37+
38+
mkdir -p /tmp/copilotcli
39+
pushd /tmp/copilotcli
40+
wget --show-progress --progress=dot:giga ${release_url}
41+
# curl -fL# -O ${release_url}
42+
tar -xzf /tmp/copilotcli/${cli_filename}
43+
mv copilot /usr/local/bin/copilot
44+
popd
45+
rm -rf /tmp/copilotcli
46+
}
47+
48+
install_using_github() {
49+
check_packages wget tar ca-certificates git
50+
echo "Finished setting up dependencies"
51+
arch=$(dpkg --print-architecture)
52+
if [ "${arch}" = "amd64" ]; then
53+
arch="x64"
54+
fi
55+
if [ "${arch}" != "x64" ] && [ "${arch}" != "arm64" ]; then
56+
echo "Unsupported architecture: ${arch}" >&2
57+
exit 1
58+
fi
59+
cli_filename="copilot-linux-${arch}.tar.gz"
60+
echo "Installing GitHub Copilot CLI for ${arch} architecture: ${cli_filename}"
61+
62+
# Install latest
63+
if [ "${CLI_VERSION}" = "latest" ]; then
64+
download_from_github "https://github.com/github/copilot-cli/releases/latest/download/${cli_filename}"
65+
elif [ "${CLI_VERSION}" = "prerelease" ]; then
66+
prerelease_version="$(git ls-remote --tags https://github.com/github/copilot-cli | tail -1 | awk -F/ '{print $NF}')"
67+
download_from_github "https://github.com/github/copilot-cli/releases/download/${prerelease_version}/${cli_filename}"
68+
else
69+
# Install specific version
70+
# Add leading v to version if it doesn't start with v
71+
if [[ ! "${CLI_VERSION}" =~ ^v[0-9] ]]; then
72+
CLI_VERSION="v${CLI_VERSION}"
73+
fi
74+
download_from_github "https://github.com/github/copilot-cli/releases/download/${CLI_VERSION}/${cli_filename}"
75+
fi
76+
}
77+
78+
# Install the GitHub Copilot CLI
79+
echo "Downloading GitHub Copilot CLI..."
80+
81+
install_using_github
82+

src/docker-in-docker/devcontainer-feature.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "docker-in-docker",
3-
"version": "2.12.4",
3+
"version": "2.13.0",
44
"name": "Docker (Docker-in-Docker)",
55
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/docker-in-docker",
66
"description": "Create child containers *inside* a container, independent from the host's docker instance. Installs Docker extension in the container along with needed CLIs.",

0 commit comments

Comments
 (0)