Sometimes I like to stash commands that I use regularly. Below is a snippet of code that I find helpful from time to time. Here is a good script for catching sigterms inside of a docker container.

#!/bin/bash

term_handler() {
${TOMCAT_DIR}/bin/shutdown.sh 
  exit 143; # 128 + 15 -- SIGTERM 
}

# setup handlers
# on callback, kill the last background process, which is tail -f /dev/null and execute the specified handler
trap 'kill ${!}; term_handler' SIGTERM

# run application
${TOMCAT_DIR}/bin/startup.sh
ln -sf /dev/stdout ${TOMCAT_DIR}/catalina.out

# wait forever
while true 
do
  tail -f /dev/null & wait ${!} 
done           

Published on 18 Dec 2017 at 12:00AM under . Tags

Enjoying Microk8s, Docker, and the TICK Stack.

All the metrics. Monitoring #k8s[1]#docker[2], and #baremetal[3] using the #TICK[4] stack. Hosting #RocketChat[5]#GitLab[6]#Artifactory[7]#Nginx[8] (reverse proxy), & #Keyclock[9] (for SSO across all) in #Docker[10]. Spinning dev containers on-demand running #RoR[11] and #Cloud9[12] using #MicroK8s[13] & #MetalLB[14]pic.twitter.com/tJA9WVHagF[15]— Tom Hastings (@tghastings)

Published on 11 Dec 2020 at 12:00AM under . Tags ,

Built my first multi-platform Docker project for students who are utilizing Apple’s M1 processor…

My 1st #multiplatform #Docker build. My students are starting to jump on the #M1 train w/ #Apple.

Published on 31 Oct 2021 at 12:00AM under . Tags

Excited to announce the lunch of DevEdu[1]. Educators can create an account, create a course, and assign development environments to the course. Students access containerized development environments through their web browsers, featuring VSCode with integrated terminal access.

Instructors can configure specific environments—I use Django in my UCCS courses—where they specify the version of Python and Django each student gets. Students enroll using course links and launch containers matching the instructor’s specifications.

For students unable to purchase licenses, the platform offers docker images as open-source software so they can host the environments locally. The service also partners with bookstores to provide bulk licensing through textbook affordability programs.

The platform has proven successful at UCCS with over 100 students, eliminating the need for individual technical support on personal devices while maintaining flexibility for different programming stacks.

References

  1. devedu.io

Published on 18 Jan 2025 at 12:00AM under . Tags