intekhabrizvi/beanstalkd

By intekhabrizvi

Updated 2 months ago

Security hardened production-ready beanstalkd image based on Google's distroless image

Image
Message queues
0

327

intekhabrizvi/beanstalkd repository overview

Beanstalkd - simple, fast work queue

The security hardened production-ready beanstalkd image based on Google's distroless base image.

This is a security-hardened beanstalkd image based on Google's Distroless image. The sole purpose of this image is to create an extremely minimal image (minimal than alpine) to run the beanstalkd service in extreme isolation with significantly reduced attack vectors.

You can read more about the distroless image here

Quickstart (no data preserved)

This will delete the data once the container stops.

docker run -d --rm \
    --name beanstalkd \
    -p 11300:11300 \
    intekhabrizvi/beanstalkd:latest \
    -l 0.0.0.0 -p 11300

Quick test

We can use telnet or nc to quickly check the beanstalkd health and stats.

printf "stats\r\n" | nc localhost 11300
#or
echo -e "stats\r\n" | telnet localhost 11300

# EXAMPLE OUTPUT
# OK 1020
# ---
# current-jobs-urgent: 0
# current-jobs-ready: 0
# current-jobs-reserved: 0
# current-jobs-delayed: 0
# current-jobs-buried: 0
# cmd-put: 0
# ......

Quickstart with data preserved

This command will save all the data inside the Docker volume, hence all the data will remain preserved even after stopping the container.

  1. Create the Volume (one time)
docker volume create beanstalkd-data;
  1. Start the container with volume attached.
docker run -d --rm \
    --name beanstalkd \
    -p 11300:11300 \
    -v beanstalkd-data:/data \
    intekhabrizvi/beanstalkd:latest \
    -b /data -f 50 -l 0.0.0.0 -p 11300

Docker compose example

services:
  beanstalkd:
    image: intekhabrizvi/beanstalkd:latest
    ports:
      - "11300:11300"
    # You can put your flags here
    command: ["-b", "/data", "-f", "50"]
    volumes:
      - beanstalkd_data:/data
volumes:
  beanstalkd_data:

Beanstalkd Binary Options

FlagDescriptionDefault / Notes
-l <addr>Listen on address <addr>(default is 0.0.0.0)
-p <port>Listen on TCP port <port>(default is 11300)
-hShow the command line help and summary of options.
-b <dir>Use a binlog to keep jobs on persistent storage in <dir>. Upon startup, beanstalkd will recover any binlog that is present in <dir>, then, during normal operation, append new jobs and changes in state to the binlog.
-dDetach and run beanstalkd as a daemon.
-f <ms>Call fsync(2) at most once every <ms> milliseconds. This will recuce disk activity and improve speed at the cost of safety. A power failure could result in the loss of up to <ms> milliseconds of history. A <ms> value of 0 will cause beanstalkd to call fsync every time it writes to the binlog.This option has no effect without the -b option.
-FNever call fsync(2) function. This is like -f with a <ms> value of infinity.This option has no effect without the -b option.
-s <bytes>The maximum size in bytes of each binlog file.This option has no effect without the -b option.
-u <user>Become the user <user> and its primary group.
-z <bytes>The maximum size in bytes of a job.

Tag summary

Content type

Image

Digest

sha256:e8d51f0aa

Size

8.1 MB

Last updated

2 months ago

docker pull intekhabrizvi/beanstalkd