Skip to content

Instantly share code, notes, and snippets.

philipz philipz

Block or report user

Report or block philipz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@philipz
philipz / readme.md
Created May 2, 2019
Add user in Dockerfile
View readme.md

RUN groupadd -r mysql && useradd -r -g mysql mysql

@philipz
philipz / readme.md
Last active Apr 29, 2019
TriggerMesh Knative-local-registry "ErrImagePull"
View readme.md
@philipz
philipz / readme.md
Created Apr 28, 2019
Kaniko to Docker Hub
View readme.md

A quick look at Google's Kaniko project

docker run -v $PWD:/workspace -v ~/.docker/config.json:/kaniko/config.json \
 --env DOCKER_CONFIG=/kaniko \
 gcr.io/kaniko-project/executor:latest \
 -d philipz/hello-world:kaniko
@philipz
philipz / Dockerfile.md
Created Apr 27, 2019
Azure Function for Knative
View Dockerfile.md
@philipz
philipz / autoscale.yaml
Created Apr 27, 2019
Knative Auto Scaling
View autoscale.yaml
apiVersion: serving.knative.dev/v1alpha1
kind: Service
metadata:
name: azurefunc
namespace: default
spec:
runLatest:
configuration:
revisionTemplate:
metadata:
@philipz
philipz / readme.md
Created Apr 25, 2019
Docker Save/Load Tgz
View readme.md
#for not running docker, use save:
docker save <dockernameortag> | gzip > mycontainer.tgz

#for running or paused docker, use export:
docker export <dockernameortag> | gzip > mycontainer.tgz

#load
gunzip -c mycontainer.tgz | docker load
@philipz
philipz / readme.md
Created Apr 15, 2019
Docker multi-stage build caching
View readme.md

Caching Docker layers on serverless build hosts with multi-stage builds, --target, and --cache-from

docker build --cache-from philipz/quark:builder --target builder -t philipz/quarkus:builder .
docker build --cache-from philipz/quarkus:builder --cache-from philipz/quarkus:nativebuilder --target nativebuilder -t philipz/quarkus:nativebuilder .
docker build --cache-from philipz/quarkus:builder --cache-from philipz/quarkus:nativebuilder --cache-from philipz/quarkus:lddpackage --target lddpackage -t philipz/quarkus:lddpackage .
docker build --cache-from philipz/quarkus:builder --cache-from philipz/quarkus:nativebuilder --cache-from philipz/quarkus:lddpackage --cache-from philipz/quarkus_hello  -t philipz/quarkus_hello .
@philipz
philipz / readme.md
Created Apr 7, 2019
How to create Maven M2 folder tar file
View readme.md

Create m2.tar.gz:

mvn -Dmaven.repo.local=./m2 clean package
tar cvf m2.tar.gz ./m2
@philipz
philipz / readme.md
Last active Apr 5, 2019
JVM opts in Docker
View readme.md
docker run -d -p 8080:8080 -e "JAVA_TOOL_OPTIONS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:InitialRAMFraction=2 -XX:MinRAMFraction=2 -XX:MaxRAMFraction=2 -XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:+UseStringDeduplication -XX:+ExitOnOutOfMemoryError" -m 1g myimage

docker exec -ti 16f7 java -XshowSettings:vm -XX:+PrintCommandLineFlags -version

View readme.md
            <plugin>
                <groupId>com.google.cloud.tools</groupId>
                <artifactId>jib-maven-plugin</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <to>
                        <image>myimage</image>
                    </to>
                    <container>
You can’t perform that action at this time.