国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
| alias dockerfile='script.sh' | |
| script.sh: | |
| #!/bin/bash | |
| echo "FROM scratch" | |
| docker history --no-trunc $@ | tac | tr -s ' ' | cut -d " " -f 5- | sed 's,^/bin/sh -c #(nop) ,,g' | sed 's,^/bin/sh -c,RUN,g' | sed 's, && , \\\n & ,g' | sed 's,\s*[0-9]*[\.]*[0-9]*\s*[kMG]*B\s*$,,g' | head -n -1 | |
国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
| import time | |
| import select | |
| import socket | |
| class AsyncSleep: | |
| """Event and action to sleep ``until`` a point in time""" | |
| def __init__(self, until): | |
| self.until = until |
| { | |
| "php": { | |
| "classes": { | |
| "App": { | |
| "functions": { | |
| "__construct": "($request = null)", | |
| "bindInstallPaths": "($paths)", | |
| "getBootstrapFile": "()", | |
| "startExceptionHandling": "()", | |
| "environment": "()", |
| #include <stdio.h> | |
| #include <stdarg.h> | |
| #include <stddef.h> | |
| typedef int jint; | |
| typedef int jclass; | |
| typedef int jobject; | |
| typedef int jmethodID; | |
| typedef int jfieldID; | |
| typedef int JNIEnv; |
| import BaseHTTPServer | |
| from SimpleHTTPServer import SimpleHTTPRequestHandler | |
| import sys | |
| import base64 | |
| key = "" | |
| class AuthHandler(SimpleHTTPRequestHandler): | |
| ''' Main class to present webpages and authentication. ''' | |
| def do_HEAD(self): |
| ## Install a necessary packages | |
| $ sudo apt-get install kvm cloud-utils genisoimage | |
| ## URL to most recent cloud image of 12.04 | |
| $ img_url="http://cloud-images.ubuntu.com/server/releases/12.04/release" | |
| $ img_url="${img_url}/ubuntu-12.04-server-cloudimg-amd64-disk1.img" | |
| ## download the image | |
| $ wget $img_url -O disk.img.dist | |
| ## Create a file with some user-data in it |