Skip to content

ministryofjustice/analytical-platform-visual-studio-code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Analytical Platform Visual Studio Code

repo standards badge

This repository contains the Visual Studio Code container image for use in the Analytical Platform.

This repository is managed in Terraform here.

Features

The base container image is Ubuntu 24.04 LTS.

Additionally the following tools are installed:

Running Locally

Build

docker build --platform linux/amd64 --file Dockerfile --tag analytical-platform.service.justice.gov.uk/visual-studio-code:local .

Run

docker run -it --rm \
  --platform linux/amd64 \
  --publish 8080:8080 \
  --hostname code \
  --name analytical-platform-code \
  analytical-platform.service.justice.gov.uk/visual-studio-code:local

Use

Open a browser http://localhost:8080/?folder=/home/analyticalplatform/workspace

Versions

Ubuntu

Generally Dependabot does this, but the following command will return the digest:

docker pull --platform linux/amd64 public.ecr.aws/ubuntu/ubuntu:24.04

docker image inspect --format='{{index .RepoDigests 0}}' public.ecr.aws/ubuntu/ubuntu:24.04

APT Packages

To find latest APT package versions, you can run the following:

docker run -it --rm --platform linux/amd64 public.ecr.aws/ubuntu/ubuntu:24.04

apt-get update

apt-cache policy ${PACKAGE} # for example curl, git or gpg

Visual Studio Code

Releases for Visual Studio Code are published on GitHub, but we specifically want the Debian package version, to obtain this you can run the following:

curl --silent https://packages.microsoft.com/repos/code/pool/main/c/code/ | grep $(curl --silent https://api.github.com/repos/microsoft/vscode/releases/latest | jq -r .tag_name) | grep amd64

This will return a string like:

<a href="code_1.86.2-1707854558_amd64.deb">code_1.86.2-1707854558_amd64.deb</a> ...

From that, we want 1.86.2-1707854558.

AWS CLI

Releases for AWS CLI are maintained on GitHub.

The GPG public key used for verification of AWS CLI is not hosted in a way where we can consume it programatically, instead its on this page under "(Optional) Verifying the integrity of your downloaded ZIP file".

As of 20/02/24, the GPG public key used for verifying AWS CLI expires 26/07/24, but there is an issue to track it.

Amazon Corretto

The last version of Amazon Corretto can be obtained by running:

docker run -it --rm --platform linux/amd64 public.ecr.aws/ubuntu/ubuntu:24.04

apt-get update

apt-get install --yes curl gpg

curl --location --fail-with-body \
  "https://apt.corretto.aws/corretto.key" \
  --output corretto.key

cat corretto.key | gpg --dearmor --output corretto-keyring.gpg

install -D --owner root --group root --mode 644 corretto-keyring.gpg /etc/apt/keyrings/corretto-keyring.gpg

echo "deb [signed-by=/etc/apt/keyrings/corretto-keyring.gpg] https://apt.corretto.aws stable main" > /etc/apt/sources.list.d/corretto.list

apt-get update --yes

apt-cache policy java-21-amazon-corretto-jdk

Miniconda

Releases for Miniconda are maintained on docs.anaconda.com, from there we can use repo.anaconda.com to determine the artefact name and SHA256 based on a version. We currently use py312, Linux and x86_64variant.

.NET SDK

The latest version of .NET SDK can be obtained by running:

docker run -it --rm --platform linux/amd64 public.ecr.aws/ubuntu/ubuntu:24.04

apt-get update --yes

apt-cache policy dotnet-sdk-8.0

Ollama

Releases for Ollama are maintained on GitHub.

Ollama don't currently provide SHA256 checksum for their installation file. For now, a checksum was acquired by running the following command locally:

curl --location --fail-with-body "https://github.com/ollama/ollama/releases/download/$(curl --silent https://api.github.com/repos/ollama/ollama/releases/latest | jq -r .tag_name)/ollama-linux-amd64" | sha256sum