How to use [zaiste/postgresql][1] Docker container.
docker pull zaiste/postgresql
CONTAINER=$(docker run -d -p 5432 \
import React from 'react' | |
import ScopeStyle from 'react-scopestyle' | |
let css = "div { color:pink; }" | |
export default class MyScopeStyleComponent extends React.Component { | |
render() { | |
return ( | |
<ScopeStyle style={css}> | |
<div>yolo</div> |
import React from 'react' | |
import { InjectStyle } from 'react-scopestyle' | |
import Component from './component' | |
React.render( | |
<div className="app"> | |
<InjectStyle /> | |
<Component /> | |
</div> | |
, document.body) |
import React from 'react' | |
import { FireStarter } from './fireflux' | |
import Component from './component' | |
@FireStarter('https://fireflux.firebaseio.com/') | |
class App extends React.Component { | |
render() { | |
return <Component /> | |
} | |
} |
if ! $(psql template1 -c 'SHOW SERVER_ENCODING' | grep -q UTF8); then | |
psql postgres -c "update pg_database set datallowconn = TRUE where datname = 'template0';" | |
psql template0 -c "update pg_database set datistemplate = FALSE where datname = 'template1';" | |
psql template0 -c "drop database template1;" | |
psql template0 -c "create database template1 with template = template0 encoding = 'UTF8';" | |
psql template0 -c "update pg_database set datistemplate = TRUE where datname = 'template1';" | |
psql template1 -c "update pg_database set datallowconn = FALSE where datname = 'template0';" | |
fi |
Unionize lets you connect together docker containers in arbitrarily complex scenarios.
Just check those examples.
Let's create two containers, running the web tier and the database tier:
// _* implementations go here. They all return a list of locations. | |
var MapMonad = function(locations) { | |
return { | |
fit : function(map) { return MapMonad(_fit(locations, map)); }, | |
sprinkle : function(map) { return MapMonad(_sprinkle(locations, map)); }, | |
mark : function(map) { return MapMonad(_mark(locations, map)); }, | |
hide : function() { return MapMonad(_hide(locations)); }, | |
filter : function(fn) { return MapMonad(_filter(fn)); }, | |
locations : locations |
define([], function() { | |
function dom() {} | |
dom.prototype = new Array; | |
dom.prototype.append = function(element) { element.map(function(e) { this[0].appendChild(e) }.bind(this)); return this} | |
dom.prototype.remove = function() { this.map(function(e) {e.parentNode.removeChild(e)}); return this} | |
dom.prototype.prepend = function(element) { element.map(function(e) { this[0].insertBefore(e, this[0].childNodes[0]) }.bind(this)); return this} | |
dom.prototype.empty = function(elements) { this.map(function(e) { e.innerHTML = ""}); return this} | |
dom.prototype.addClass = function(classes) { this.map(function(e) { e.className += ' '+classes}); return this} | |
dom.prototype.removeClass = function(classes) { |
kernel: | |
image: "linuxkit/kernel:4.9.x" | |
cmdline: "console=ttyS0 console=tty0 page_poison=1" | |
init: | |
- linuxkit/init:63eed9ca7a09d2ce4c0c5e7238ac005fa44f564b | |
- linuxkit/runc:b0fb122e10dbb7e4e45115177a61a3f8d68c19a9 | |
- linuxkit/containerd:18eaf72f3f4f9a9f29ca1951f66df701f873060b | |
- linuxkit/ca-certificates:5fc6ba7f91534ddbfef975404c33e44581e6ed7a | |
onboot: | |
- name: sysctl |
#!/usr/bin/env node | |
const fs = require('fs') | |
const { execSync } = require('child_process'); | |
const args = process.argv.slice(2) | |
const stack = args[0] | |
const stackfile = stack+'.yml' | |
const SWARM_SERVICES_RAW = execSync(`docker service ls | grep ${stack} | awk '{print $5}'`) | |
const STACKFILE_SERVICES_RAW = execSync(`cat ${stackfile} | grep image | awk '{print $2}'`) | |
let swarm_services = SWARM_SERVICES_RAW.toString().split('\n') |