Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Create VSCode Dev Container #3821

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
{
"name": "aro-rp dev",
"build": {
// Sets the run context to one level up instead of the .devcontainer folder.
"context": "..",
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerfile": "../Dockerfile.ci-rp",
"target": "rp-dev",
"args": {
"REGISTRY": "registry.access.redhat.com"
}
},
"runArgs": [
// our builds are crazy big - need more resources
"--ulimit=nofile=8192:8192"
],
"postCreateCommand": "go mod download && make install-tools",

// Podman required config
"remoteUser": "root",
"privileged": true,

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [
// ARO RP API
8443,

// SRE Portal Web UI
8444,

// SRE Portal SSH Port
2222
],

// Configure tool-specific properties.
"customizations": {
"vscode": {
"settings": {},
"extensions": [
"golang.go",
"ms-vscode.makefile-tools",
"ms-vsliveshare.vsliveshare"
]
}
}
}
27 changes: 22 additions & 5 deletions Dockerfile.ci-rp
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
ARG REGISTRY
ARG ARO_VERSION

###############################################################################
# Stage 0: Dev Container Base Image
###############################################################################
FROM ${REGISTRY}/ubi8/go-toolset:1.21.11-1.1720406008 AS rp-dev
USER root
RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc \
&& dnf install -y https://packages.microsoft.com/config/rhel/8/packages-microsoft-prod.rpm \
&& dnf install -y \
azure-cli \
gpgme-devel \
libassuan-devel \
llvm-devel \
openssl \
make \
podman \
&& dnf upgrade -y

WORKDIR /app

ENV GOPATH=/root/go

###############################################################################
# Stage 1: Build the SRE Portal Assets
###############################################################################
Expand All @@ -22,14 +43,10 @@ LABEL stage="portal-build-cache-layer"
###############################################################################
# Stage 2: Compile the Golang RP code
###############################################################################
FROM ${REGISTRY}/ubi8/go-toolset:1.21.11-1.1720406008 AS builder
FROM rp-dev AS builder
ARG ARO_VERSION
LABEL aro-builder=true
USER root
WORKDIR /app

# golang config and build steps
ENV GOPATH=/root/go
ENV GOFLAGS="-tags=containers_image_openpgp,exclude_graphdriver_btrfs,exclude_graphdriver_devicemapper"

COPY .bingo .bingo
Expand Down
Loading