Skip to content

Instantly share code, notes, and snippets.

View dmcgowan's full-sized avatar

Derek McGowan dmcgowan

View GitHub Profile
#!/bin/sh
set -e
tmpdir=$(mktemp -d)
volume=$1
shift
if [ ! -f $volume ]; then
@dmcgowan
dmcgowan / fetch.sh
Last active January 24, 2017 21:36
Script to fetch image configurations from hub
#!/bin/sh
if [ "$#" -ne 2 ]; then
echo "Wrong arguments, expect: <name> <tag>"
fi
IMAGE=$1
TAG=$2
TOKEN=$(curl -s "https://auth.docker.io/token?scope=repository:$IMAGE:pull&service=registry.docker.io" | jq -r .token)
CONFIG_DIGEST=$(curl -s -H"Accept: application/vnd.docker.distribution.manifest.v2+json" -H"Authorization: Bearer $TOKEN" "https://registry-1.docker.io/v2/$IMAGE/manifests/$TAG" | jq -r .config.digest)
@dmcgowan
dmcgowan / image_backend.go
Created May 5, 2017 23:26
Notes about requirements of Daemon for image management backend
package daemon
import (
"io"
"github.com/docker/distribution/reference"
"github.com/docker/docker/image"
"github.com/docker/docker/layer"
digest "github.com/opencontainers/go-digest"
)
@dmcgowan
dmcgowan / containerd.service
Last active October 25, 2017 00:39
Containerd stress run script
[Unit]
Description=containerd container runtime
Documentation=https://containerd.io
After=network.target
[Service]
ExecStartPre=/sbin/modprobe overlay
ExecStart=/usr/local/bin/containerd
Delegate=yes
KillMode=process
@dmcgowan
dmcgowan / overlay_test.sh
Created April 27, 2018 21:30
Test overlay multiple depths
#!/bin/sh
set -x
tempdir=$(mktemp -d)
oldpwd=$(pwd)
function cleanup() {
cd $oldpwd
umount -fR $tempdir
@dmcgowan
dmcgowan / main.go
Created April 16, 2023 07:48
Proxy differ using containerd default applier
/*
Copyright The containerd Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software