Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jvrck committed Oct 3, 2024
0 parents commit b3a5859
Show file tree
Hide file tree
Showing 12 changed files with 266 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{
"name": "Dev Container",

"image": "ghcr.io/jvrck/noble-full"

}
12 changes: 12 additions & 0 deletions .devcontainer/devcontainer.json.docker-mount
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{
"name": "Dev Container",

"image": "ghcr.io/jvrck/noble-full",

"mounts": [
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind"
],
"privileged": true
}
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for more information:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
# https://containers.dev/guide/dependabot

version: 2
updates:
- package-ecosystem: "devcontainers"
directory: "noble-full-base/"
schedule:
interval: weekly
43 changes: 43 additions & 0 deletions .github/workflows/build-noble-base.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build and Push Noble Full Base

on:
push:
branches:
- 'main'
- 'master'
schedule:
- cron: '0 0 */3 * *' # Runs every 3 days at midnight UTC
jobs:
build-noble-full-base:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@main

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@master

- name: Login to Github Packages
uses: docker/login-action@master
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GH_TOKEN }}

- name: Set up Node.js
uses: actions/setup-node@main
with:
node-version: '20'

- name: Build noble-full-base devcontainer
run: |
npm install -g @devcontainers/cli
- name: Build noble-full-base devcontainer
run: |
devcontainer build --image-name ghcr.io/jvrck/noble-full-base --platform "linux/amd64" --push false --workspace-folder noble-full-base
- name: Push noble-full Docker image
run: |
docker push ghcr.io/jvrck/noble-full-base
44 changes: 44 additions & 0 deletions .github/workflows/build-noble.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build and Push Noble Full

on:
push:
branches:
- '**'
schedule:
- cron: '0 0 * * 0' # Runs at 00:00 UTC every Sunday

jobs:
build-and-push:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@main

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@master

- name: Login to Github Packages
uses: docker/login-action@master
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GH_TOKEN }}

- name: Set push variable
id: set-push
run: |
if [[ "${{ github.ref }}" == "refs/heads/main" || "${{ github.ref }}" == "refs/heads/master" ]]; then
echo "PUSH=true" >> $GITHUB_ENV
else
echo "PUSH=false" >> $GITHUB_ENV
fi
- name: Build and push noble-full Docker image
uses: docker/build-push-action@master
with:
context: noble-full
file: noble-full/Dockerfile
platforms: linux/amd64 #inux/amd64,linux/arm64
push: ${{ env.PUSH }}
tags: ghcr.io/jvrck/noble-full:latest
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.0.1] - 2024-10-04
### Added
- Initial release
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Jim Vrckovski

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Makefile for BB-Runner CloudFormation Stack

# Phony targets
.PHONY: help

build-full-base:
devcontainer build --image-name ghcr.io/jvrck/noble-full-base --platform "linux/amd64" --push false --workspace-folder noble-full-base
build-full:
docker build -t ghcr.io/jvrck/noble-full ./noble-full
pull:
docker login ghcr.io -u $(GH_USER) -p $(GH_TOKEN)
docker pull ghcr.io/jvrck/noble-full-base
docker pull ghcr.io/jvrck/noble-full

# Help
help:
@echo "Available commands:"
@echo " make build-full-base - Build noble-full-base devcontainer"
@echo " make build-full - Build noble-full from base"
@echo " make pull - Pull images from ghcr.io"
@echo " make help - Show this help message"
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# noble-prebuild

This repository is a prebuilt [Devcontainer](https://containers.dev/) that uses the [Devcontainer features](https://containers.dev/features) to build a base image and then installs additional software.

## jvrck/noble-full image
This is a prebuilt image that is based on the latest devcontainers Ubuntu 24.04 noble base and contains the following software:

- Docker in Docker (via Devcontainer feature)
- Python 3.12 (via Devcontainer feature)
- Node.js 20 (via Devcontainer feature)
- AWS CLI v2 (via Devcontainer feature)
- Github CLI
- MySQL Client
- PostgreSQL Client
- Devcontainer CLI

## How to use this image
To use this image, you can create a `.devcontainer/devcontainer.json` file in your project and add the following configuration:

```json
{
"name": "Dev Container",
"image": "ghcr.io/jvrck/noble-full"
}
```
To run a Devcontainer, you can use the [VS Code Remote - Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) and select the `Reopen in Container` option.

This will open a new VS Code window with the Devcontainer running.

This will also work with Github Codespaces, as the Devcontainer feature is supported.

## License
This repository is licensed under the MIT License. See the [LICENSE](LICENSE) file for more information.
29 changes: 29 additions & 0 deletions noble-full-base/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "JVRCK Noble Full Base",

"image": "mcr.microsoft.com/devcontainers/base:noble",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"moby": true,
"azureDnsAutoDetection": true,
"installDockerBuildx": true,
"installDockerComposeSwitch": true,
"version": "latest",
"dockerDashComposeVersion": "latest"
},
"ghcr.io/devcontainers/features/aws-cli:1": {
"version": "latest"
},
"ghcr.io/devcontainers/features/node:1": {
"nodeGypDependencies": true,
"installYarnUsingApt": true,
"version": "lts",
"pnpmVersion": "latest",
"nvmVersion": "latest"
},
"ghcr.io/devcontainers/features/python:1": {
"installTools": true,
"version": "3.12"
}
}
}
11 changes: 11 additions & 0 deletions noble-full/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM ghcr.io/jvrck/noble-full-base:latest

WORKDIR /app

# Copy the setup script and run it
COPY setup.sh /app
RUN chmod +x /app/setup.sh
RUN /app/setup.sh
RUN rm -rf /app/setup.sh

CMD ["/bin/bash"]
22 changes: 22 additions & 0 deletions noble-full/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# Run as part of the container setup
# Install other stuff that the container rquires

# Update and install some basic tools
apt update && apt upgrade -y
apt install gh -y
apt install vim -y

# Install posgresql client
apt install postgresql-client -y

# Install mysql client
apt install mysql-client -y

# Install pyinfo
curl -s https://raw.githubusercontent.com/jvrck/pyinfo/master/install | sudo bash

# Anything that requires npm or nodejs should be done here.
source /usr/local/share/nvm/nvm.sh
npm install -g @devcontainers/cli

0 comments on commit b3a5859

Please sign in to comment.