Setup OCI Function Development on Windows with WSL2

Joe NgoJoe Ngo
2 min read

Install WSL2 - Ubuntu

  1. Open the Microsoft Store.

  2. Search for Ubuntu 24.04

  3. Install

Launch Ubuntu terminal

  1. Search for "Ubuntu" in your apps.

  2. On the initial launch, you'll be prompted to create a username and password. Set these and remember them.

  3. Execute the following commands:

     sudo apt update && sudo apt full-upgrade -y
    

Install podman-docker

sudo apt install podman-docker
sudo touch /etc/containers/nodocker

Install Fn CLI

curl -LSs https://raw.githubusercontent.com/fnproject/cli/master/install | sh

Set the Fn settings to use the Podman engine by adding or updating the following line:

vi ~/.fn/config.yaml

Add or update line:

container-enginetype: podman

Install OCI CLI

sudo apt install python3-pip
pip3 install oci-cli --break-system-packages

Create .bash_profile

vi ~/.bash_profile

Set the file contents as follows:

#!/bin/bash

source ~/.bashrc
export PATH=~/.local/bin:$PATH

Setup Config

oci setup config

Complete Fn Setup

Follow steps 4 onwards in the Functions QuickStart on Local Host.

NOTES:

  • Step 4.3 is optional. Set it if you're using a profile other than the DEFAULT profile in the OCI CLI config.

  • Step 5.3: you can get the tenancy namespace by executing oci os ns get.

Development in VS Code

  1. Install the Remote Development extension in VS Code.

  2. Connect to WSL

0
Subscribe to my newsletter

Read articles from Joe Ngo directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Joe Ngo
Joe Ngo