Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am zbal on github.
  • I am zbal (https://keybase.io/zbal) on keybase.
  • I have a public key ASADXMRVxLoYRxj6Xx5egfwgpjN0wudB_hSwU0J-lWWVFgo

To claim this, I am signing this object:

@zbal
zbal / Dockerfile
Created January 28, 2019 04:35
Dockerfile - Multi step build process for node.js
# One single Dockerfile with a multi step build process
# 1. build all native extensions, dependencies, etc.
# 2. copy resulting files into a clean container
FROM node:10-alpine as builder
# Add core packages to allow building native extensions
RUN apk add --no-cache make gcc g++ python
RUN npm install -g yarn
WORKDIR /src
COPY package.json yarn.lock /src/
@zbal
zbal / README.md
Created January 15, 2019 07:23 — forked from xuqingfeng/README.md
Demo terraform script for spawning k8s multi AZ cluster in AliCloud

Install terraform

Refer to the official documentation and download page:

Configure

export ALICLOUD_ACCESS_KEY="anaccesskey"
export ALICLOUD_SECRET_KEY="asecretkey"
# Prepare the app
- run: devops nodejs app add
options:
name: "{{ app_name }}"
root: /opt/{{ app_name }}/bundle
script: main.js
node_env: prod
user: devops
extra_env: >
"PORT=3000
#!/bin/bash
#####
# Builds a custom nginx
#
RELEASE_TAGS="+lua+$(lsb_release -s -c)"
RELEASE_MAINTAINER=
RELEASE_MAINTAINER_EMAIL=
RELEASE_MESSAGE="Add LUA support to nginx"
#
---
some:
thing: is
awesome:
- that
- is
- an
- array
# Based on https://gist.github.com/fernandoaleman/5083680
# Start the old vagrant
$ vagrant init ubuntu_saucy
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
Option 1 - using a class:
def run(env, command, args):
plugin = Plugin(env)
# Check if the command is defined in the plugin
if 'do_'+ command not in dir(plugin):
return False
# Call function
getattr(plugin, 'do_'+ command)(args)
@zbal
zbal / gist:6724926
Last active November 7, 2016 12:56
new Dockerfile based on the previous base image
FROM id_from_prev_build_image
MAINTAINER me@example.com
RUN apt-get update
RUN apt-get upgrade -y
RUN echo 'toto' > /test
@zbal
zbal / gist:6724907
Created September 27, 2013 06:42
base Dockerfile
FROM ubuntu:precise
MAINTAINER me@example.com
# Prepare chinese apt mirror - upgrade to latest
RUN printf "deb http://mirrors.163.com/ubuntu precise main\ndeb http://mirrors.163.com/ubuntu/ precise universe\n" > /etc/apt/sources.list
RUN apt-get update
RUN apt-get upgrade -y
# Cheat upstart
RUN dpkg-divert --local --rename --add /sbin/initctl