Skip to content

Commit

Permalink
Update repository
Browse files Browse the repository at this point in the history
  • Loading branch information
ehfd authored May 3, 2023
1 parent d88e72f commit af2cc15
Show file tree
Hide file tree
Showing 9 changed files with 409 additions and 683 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/container-publish.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.

on:
push:
branches: [ main ]
Expand All @@ -15,21 +19,21 @@ jobs:
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v3
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
Expand Down
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
FROM nvidia/opengl:1.2-glvnd-runtime-ubuntu20.04
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.

FROM ubuntu:22.04

RUN apt-get update && apt-get install -y \
apt-utils \
Expand Down
1,047 changes: 373 additions & 674 deletions LICENSE

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Based on https://github.com/cruizba/ubuntu-dind

Isolated DinD (Docker in Docker) container for developing and deploying docker containers using NVIDIA GPUs and the NVIDIA container toolkit. Useful for deploying the docker engine with NVIDIA in Kubernetes.

Host is required to have the NVIDIA container toolkit installed and set up. Privileged mode is required like any other DinD container with root requirement.
Host is required to have the NVIDIA container toolkit installed and set up. Privileged mode or [Sysbox](https://github.com/nestybox/sysbox) is required like any other DinD container with root requirement.

```
docker run --gpus 1 -it --privileged ghcr.io/ehfd/nvidia-dind:latest
Expand Down
5 changes: 4 additions & 1 deletion logger.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/sh
# http://www.cubicrace.com/2016/03/log-tracing-mechnism-for-shell-scripts.html

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.

function INFO(){
local function_name="${FUNCNAME[1]}"
Expand Down
7 changes: 5 additions & 2 deletions modprobe
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#!/bin/sh
set -eu

# https://twitter.com/lucabruno/status/902934379835662336
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.

set -eu

# Docker often uses "modprobe -va foo bar baz"
# so we ignore modules that start with "-"
Expand Down
4 changes: 4 additions & 0 deletions nvidia-dind.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.

apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down
5 changes: 5 additions & 0 deletions startup.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#!/bin/bash

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.

source /opt/bash-utils/logger.sh

function wait_for_process () {
Expand Down
4 changes: 4 additions & 0 deletions supervisor/dockerd.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.

[program:dockerd]
command=/usr/bin/dockerd
autostart=true
Expand Down

0 comments on commit af2cc15

Please sign in to comment.