Docker

Docker Compose Tailing of Log Files

Docker Compose Logs docker compose logs aggregates stdout of containers started with no out-of-the-box capability for aggregating additional logs generated on container filesystems. Implementing sidecar allows tailing logs generated on container volumes. docker-compose.yaml services: counter: image: busybox command: | /bin/sh -c 'i=0; while true; do echo "$$(date) WARN $$i" >> /var/log/1.log; echo "$$(date) INFO $$i" >> /var/log/2.log; i=$$((i+1)); sleep 5; done' volumes: - log-volume:/var/log counter-log: image: busybox command: | /bin/sh -c 'tail -n+1 -F /var/log/*.

Packaging AWS Lambda functions with large dependencies as containers

While the actual application code for many lambda functions might be small, in many (data science) usecases libraries used and to be packaged together push over the deployment package limit of 50 MB compressed. Container packaging to the rescue. A sample Dockerfile installing SageMaker Python SDK ARG WORK_DIR="/home/app/" FROM public.ecr.aws/lambda/python:3.8 ARG WORK_DIR RUN pip install wheel sagemaker COPY main.py . WORKDIR ${WORK_DIR} CMD ["main.handler"] and corresponding main.py import sagemaker import sys def handler(event, context): print(sys.

Running Jupyterhub Docker

Jupyterhub doesn’t seem to have complete instructions available on simply running an instance under Docker with a number of issues, Stackoverflow questions asking for clarifications. These are my quick notes: As the Docker image name indicates, this is singleuser instance preconfigured for user jovyan. Run below command in directory with your notebooks docker run --rm -p 8000:8000 -d -v `pwd`:/home/jovyan/work --name jupyterhub jupyterhub/singleuser jupyterhub There doesn’t seem to be (default) password set for jovyan user, so at this point you cannot login into the GUI.