$ cd /path/to/Dockerfile
$ sudo docker build .
View running processes
# Ubuntu upstart file at /etc/init/yourservice.conf | |
pre-start script | |
mkdir -p /var/log/yourcompany/ | |
end script | |
respawn | |
respawn limit 15 5 | |
start on runlevel [2345] |
var BASE64_MARKER = ';base64,'; | |
function convertDataURIToBinary(dataURI) { | |
var base64Index = dataURI.indexOf(BASE64_MARKER) + BASE64_MARKER.length; | |
var base64 = dataURI.substring(base64Index); | |
var raw = window.atob(base64); | |
var rawLength = raw.length; | |
var array = new Uint8Array(new ArrayBuffer(rawLength)); | |
for(i = 0; i < rawLength; i++) { |
def segment_items(items, max_count_per_segment): | |
result = [] | |
index = 0 | |
while index < len(items): | |
segment = [] | |
segment_index = 0 | |
while segment_index < max_count_per_segment and index < len(items): | |
item = items[index] | |
segment.append(item) | |
segment_index += 1 |
package main | |
import ( | |
"log" | |
"bufio" | |
"time" | |
"os" | |
"fmt" | |
"io" | |
"net" |
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key | |
# Don't add passphrase | |
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | |
cat jwtRS256.key | |
cat jwtRS256.key.pub |
You can use CodePipeline and CodeBuild to create a continuous deployment/integration pipeline for serverless applications build on AWS Lambda and Amazon API Gateway. This sample application is written in Go with the Gin framework and uses the eawsy API Gateway proxy shim: https://github.com/eawsy/aws-lambda-go-net
We initially detailed our methodology in this blog post: https://aws.amazon.com/blogs/compute/continuous-deployment-for-serverless-applications/
We have used the shim technology created by eawsy to run Golang applications inside AWS Lambda (https://github.com/eawsy/aws-lambda-go-shim) and created a container that can be used with CodeBuild as part of our original pipeline template.
The container is available on DockerHub and is called sapessi/aws-lambda-go18-codebuild:latest
. To use this container, simply change the Image
property of the CodeBuild project environment.
The pipeline template, sample app, buildspec and SAM files are attached to this gist.