Skip to content

Instantly share code, notes, and snippets.

View initcron's full-sized avatar

Gourav Shah initcron

View GitHub Profile
@initcron
initcron / user-data-k8s-containerd.sh
Created November 22, 2022 03:44
User Data Script to Setup Kubernetes Nodes with Containerd as the Runtime
#!/bin/bash
apt-get update
apt-get install -y git wget
# Install Docker
apt-get install -yq \
apt-transport-https \
ca-certificates \
curl \
@initcron
initcron / vote-rs.yaml
Created November 21, 2022 06:41
Spot the Error with this Replicaset, Selector Spec
apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: vote
labels:
role: vote
spec:
replicas: 4
selector:
matchLabels:
@initcron
initcron / delay_entrypoint.md
Created November 3, 2022 16:36
How to add a delay to start the service with Docker.

Step 1: Create a file ep.sh with the following content,

#!/bin/sh

echo "I: Sleeping for 20seconds....."
sleep 20

exec "$@"
@initcron
initcron / Dockerfile
Created November 3, 2022 13:13
Multistage Dockerfile for Petclinic
FROM schoolofdevops/maven:spring AS BUILD
WORKDIR /app
COPY . .
RUN mvn spring-javaformat:apply && \
mvn package -DskipTests
FROM openjdk:8u212-jre-alpine3.9 AS PKG
WORKDIR /run
COPY --from=BUILD /app/target/spring-petclinic-2.3.1.BUILD-SNAPSHOT.jar /run/petclinic.jar
EXPOSE 8080
@initcron
initcron / docker-compose.yaml
Created October 20, 2022 10:42
Docker Compose v3
version: "3.8"
networks:
custom:
driver: bridge
services:
app:
image: xxxx/petclinic:v5
build:
@initcron
initcron / Dockerfile
Created October 19, 2022 10:39
Single Stage Dockerfile for Sprint Petclinic App
FROM schoolofdevops/maven:spring
WORKDIR /app
COPY . .
RUN mvn spring-javaformat:apply && \
mvn package -DskipTests && \
mv target/spring-petclinic-2.3.1.BUILD-SNAPSHOT.jar /run/petclinic.jar
@initcron
initcron / install_php5-apache2-ubuntu.sh
Created September 14, 2022 09:12
Install PHP 5.6 and Apache 2 on Ubuntu
#!/bin/bash
sudo LC_ALL=en_US.UTF-8 add-apt-repository -y ppa:ondrej/php
sudo LC_ALL=en_US.UTF-8 add-apt-repository -y ppa:ondrej/apache2
sudo apt update
sudo apt install -y software-properties-common language-pack-en-base dialog apt-utils
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
sudo cp /usr/share/zoneinfo/America/New_York /etc/localtime
sudo apt install -yq apache2 php5.6 php5.6-mysql mysql-client
@initcron
initcron / jenkins-ci-pod.Jenkinsfile
Created September 13, 2022 08:33
Jenkinsfile Sample Snippet with Docker Socket Mounted as a Volume
podTemplate(
volumes: [
hostPathVolume(hostPath: '/var/run/docker.sock', mountPath: '/var/run/docker.sock')
])
)
@initcron
initcron / docker-compose.yaml
Last active September 7, 2022 10:41
Docker Compose for Sprint Petclinic with v3.8
version: "3.8"
networks:
custom:
services:
app:
image: xxxxxx/petclinic:dev
build:
context: .
@initcron
initcron / docker-compose.yml
Created August 18, 2022 14:09
Spring Petclinic Compose Spec with Version 3.8
version: "3.8"
networks:
custom:
driver: bridge
services:
app:
image: initcron/petclinic:dev
build: