Skip to content

Instantly share code, notes, and snippets.

View themalkolm's full-sized avatar

Alexander Krasnukhin themalkolm

  • Sweden
View GitHub Profile
$ cat Dockerfile
FROM scratch
COPY build/foobar /usr/bin/foobar
COPY build/foobar.json /etc/foobar.json
ENTRYPOINT /usr/bin/foobar
$ docker build -f Dockerfile
...
$ cat Dockerfile.yaml
from: scratch
@themalkolm
themalkolm / gist:05447ca1238b22a98fd217a77b02c5f4
Created April 27, 2016 23:33 — forked from ldx/gist:9116170
Build a chroot with a CentOS 6.5 base install.
#!/bin/sh
#
# Build a chroot with a CentOS 6.5 base install.
#
CHROOT=/tmp/chroot
mkdir -p $CHROOT
mkdir -p $CHROOT/var/lib/rpm
build_type = os.environ['BuildType']
tgt = {
'linux': 'ip-*',
'windows': 'WIN-*',
}[build_type]
#
# Итак, упрощенный вариант для демонстрации чуда.
#
tmp := $(shell touch a.txt)
srcs := $(wildcard *.txt)
all: $(srcs)
@echo $(srcs)
tmp := $(shell touch a.txt)
srcs := $(shell echo *.txt)
all: $(srcs)
@echo $(srcs)
clean:
rm -rf *.txt
tmp := $(shell touch a.txt)
srcs := $(wildcard *.txt)
all: $(srcs)
@echo $(srcs)
clean:
rm -rf *.txt
@funcy.collecting
def unpack(*args):
d = args[-1]
for k in args[:-1]
yield d[k]
a, b = unpack('a', 'b', {'a': 1, 'b': 2, 'c': 3})
template <typename T, T def>
struct primitive_t : is_lexical_value<T> {
typedef T value_type;
primitive_t() : t(def) {}
primitive_t(T t) : t(t) {}
primitive_t& operator=(T a_t) {
t = a_t;
return *this;