Based on Alpine Linux (v3.22) from the s6 image with the influxdb package installed in it.
InfluxDB Version 1.8.10
InfluxDB has since dropped providing binaries for ARM V7/V6, so packages are unavailable in Alpine Linux Repositories since v3.17. This image uses the final pre-built packages from that repository. Newer builds will follow suit.
latest tag is annotated as multiarch so pulling without specifying any architecture tags should fetch the correct image for your architecture. Same goes for any of the version tags.
non-x86_64 images used to contain the embedded qemu-user-static binary which has been redundant for a while, and is being deprecated starting with our Alpine Linux v3.22 base-image release, see qemu-user-static or the more recent binfmt instead for running multi-arch containers.
If you want to run images built for other architectures on the same host (e.g. a x86_64 machine), you will need to have the specific binary format support configured on your host machine before running the image (otherwise you get an exec format error). Here's how,
For recent images, we can use tonistiigi's binfmtimage to register binary execution support for the target architecture, like the following,
However, that image (see qemu-user-static) seems to have fallen behind in updates, and with newer images the binfmt method is preferable.
Now images built for other architectures will also be executable. This is optional though, without the above, you can still run the image that is specifically made to support your host architecture.
We can customize the runtime behaviour of the container with the following environment variables.
ENV Vars
Default
Description
INFLUXDB_CONFIG_PATH
/etc/influxdb.conf
Default path to configuration file.
INFLUXDB_HOME
/var/lib/influxdb
Default path to datastore.
INFLUXDB_varname
unset
Override default configurations. Check this link for supported variables.
INFLUXDB_INITDIR
/var/lib/influxdb/initdb.d
Directory for .sh or .iql scripts needed to initialize database. (since 1.8.10_20250522) (Used by /scripts/run.sh) Previously named INFLUXDB_INIT_DB.
INFLUXDB_BACKUPDIR
/var/lib/influxdb/backups
Directory for backups. (Used by /scripts/run.sh)
INFLUXDB_SKIP_PERMFIX
unset
If set to a non-empty-string value (e.g. 1), skips fixing permissions for influxdb configuration files/directories. (since 1.8.10_20250722)
INFLUXDB_SKIP_INITIALIZE
unset
Set to true to skip all database initialization/bootstrap tasks. Useful when you only want the service to run. (since 1.8.10_20250522)
INFLUXDB_HTTP_AUTH_ENABLED
unset
Set to true/false in environment (or configuration) when authentication is required, default is unset.
INFLUXDB_ADMIN_USER
influxadmin
Default admin user, required for database initialization if authentication is enabled. (part of bootstrap tasks). (since 1.8.10_20250522)
INFLUXDB_ADMIN_PWD
unset
Admin user password required for database initialization if authentication is enabled. (part of bootstrap tasks). (since 1.8.10_20250522)
INFLUXDB_DATABASE
test
Default database to create when initializiting, or after initialization when authentication enabled. (since 1.8.10_20250522)
INFLUXDB_SKIP_BOOTSTRAP
unset
Set to true to skip database bootstrap tasks. Useful when you only want the initialization tasks. (since 1.8.10_20250522)
INFLUXDB_USER
influxuser
Default user for remote connections, created during bootstrap if authentication is enabled. (since 1.8.10_20250522)
INFLUXDB_USER_PWD
unset
Password for User required for creation. (since 1.8.10_20250522)
INFLUXDB_USER_GRANTS
ALL
Default user privileges, if database is set, applies only to the database, implies admin otherwise. (since 1.8.10_20250522)
INFLUXDB_HEALTHCHECK_USER
influxhc
Default user for healthchecks, created during bootstrap if authentication is enabled. (since 1.8.10_20250522)
INFLUXDB_HEALTHCHECK_USER_PWD
unset
Password for healthcheck user required for creation. (since 1.8.10_20250522)
INFLUXDB_HEALTHCHECK_USER_GRANTS
READ
Default healthcheck user privileges, if not ALL, requires database to be set, not applied otherwise. (since 1.8.10_20250522)
INFLUXDB_READ_USER
influxr
Default user for reads, created during bootstrap if authentication is enabled. (since 1.8.10_20250522)
INFLUXDB_READ_USER_PWD
unset
Password for read user required for creation. (since 1.8.10_20250522)
INFLUXDB_READ_USER_GRANTS
READ
Default read user privileges, if not ALL, requires database to be set, not applied otherwise. (since 1.8.10_20250522)
INFLUXDB_WRITE_USER
influxw
Default user for writes, created during bootstrap if authentication is enabled. (since 1.8.10_20250522)
INFLUXDB_WRITE_USER_PWD
unset
Password for write user if not ALL, required for creation. (since 1.8.10_20250522)
INFLUXDB_WRITE_USER_GRANTS
WRITE
Default write user privileges, requires database to be set, not applied otherwise. (since 1.8.10_20250522)
S6_NEEDED_PACKAGES
empty string
Space-separated list of extra APK packages to install on start. E.g. "curl git tzdata"
PUID
1000
Id of ${S6_USER}.
PGID
1000
Group id of ${S6_USER}.
S6_USER
alpine
(Preset) Default non-root user for services to drop privileges to.
S6_USERHOME
/var/lib/influxdb
(Preset) HOME directory for ${S6_USER}.
Did you know?
You can check your own UID/GID by running the command id in a terminal.
Also,
Configuration file is at /etc/influxdb.conf (the filepath preset in the env-var ${INFLUXDB_CONFIG_PATH}), edit or remount this with your own. A sample is provided in /defaults, this gets copied when no such file exists before service is started.
Default configuration starts the database server without any authorization. (Not recommended other than development or one-off testing purposes. Check the security guides for more)
To enable authentication/authorization during initialization, update the configuration file or set ${INFLUXDB_HTTP_AUTH_ENABLED} environment variable to true before starting the container.
Then, for images released after 1.8.10_20250522, set the required environment variables. At the minimum, setting ${INFLUXDB_ADMIN_PWD} is required. Now we can start the container and these configurations are applied while the database is being initialized/bootstrapped. Initialization and bootstrapping tasks are only run if the /var/lib/influxdb/meta/meta.db file does not exist, i.e. on the first run. Once the database is initialized, the relevant environment vars have no effect.
But for older images, or when the database is already initialized, this can be done manually by getting a user-scoped shell inside the container, e.g. we can create the administrator user with,
influx-execute"CREATE USER \"influxadmin\" WITH PASSWORD 'insecurebydefault' WITH ALL PRIVILEGES";
Any following executions will require -username and -password arguments set. E.g. for creating another non-root administrator (recommended to use/export these credentials as administrator, while keeping the actual administrator secret),
# export INFLUXDB_ADMIN_USER=influxadmin# export INFLUXDB_ADMIN_PASSWORD=insecurebydefaultinflux\-username"${INFLUXDB_ADMIN_USER}"\-password'${INFLUXDB_ADMIN_PASSWORD}'\-execute"CREATE USER \"influx\" WITH PASSWORD 'insecurebydefault' WITH ALL PRIVILEGES";
For creating databases (and optionally limiting user-access specific to that database), execute the following as an example, check the docs for writing your own.
CREATEDATABASE"test";-- following users operate ONLY on test-db-- test writerCREATEUSER"testwriter"WITHPASSWORD'insecurebydefaultwritetest';REVOKEALLPRIVILEGESFROM"testwriter";GRANTWRITEON"test"TO"testwriter";-- test readerCREATEUSER"testreader"WITHPASSWORD'insecurebydefaultreadtest';REVOKEALLPRIVILEGESFROM"testreader";GRANTREADON"test"TO"testreader";
A shellscript to run a few common tasks is available into the image,
If you already have customized scripts or iql files to initialize your database, mount them in /var/lib/influxdb/initdb.d, and execute them via /scripts/run.sh. Loaded automatically as part of bootstrap tasks.(since 1.8.10_20250522)
Optionally run a healthcheck query (if authentication is enabled, make sure to set either ${INFLUXDB_HEALTHCHECK_USER} and ${INFLUXDB_HEALTHCHECK_USER_PWD} or ${INFLUXDB_USER} and ${INFLUXDB_USER_PWD}) with
/scripts/run.sh healthcheck
The healthcheck query can be customized by ${INFLUXDB_HEALTHCHECK_QUERY} environment variable (defaults to SHOW DATABASES).
Stop the container with a timeout, (defaults to 2 seconds)
dockerstop-t2docker_influxdb
Restart the container with
dockerrestartdocker_influxdb
Removes the container, (always better to stop it first and -f only when needed most)
Feel free to clone (or fork) the repository and customize it for your own usage, build the image for yourself on your own systems, and optionally, push it to your own public (or private) repository.
Before we clone the /repository, we must have Git, GNU make, and Docker (optionally, with buildx plugin for multi-platform images) setup on the machine. Also, for multi-platform annotations, we might require enabling experimental features of Docker.
To create the image for your architecture, run the build and test target with
makebuildtest
For building an image that targets another architecture, it is required to specify the ARCH parameter when building. e.g.
makebuildtestARCH=aarch64
makebuildtestARCH=armhf
makebuildtestARCH=armv7l
makebuildtestARCH=i386
makebuildtestARCH=ppc64le
makebuildtestARCH=s390x
makebuildtestARCH=x86_64
Build Parameters
All images have a few common build parameters that can be customized at build time, like
ARCH
The target architecture to build for. Defaults to host architecture, auto-detected at build-time if not specified. Also determines if binfmt support is required before build or run and runs the regbinfmt (or inbinfmt for recent images) target automatically. Possible values could be aarch64, armhf, armv7l, or x86_64.
BUILDDATE
The date of the build. Can be used to create separate tags for images. (format: yyyymmdd)
DOCKERFILE
The dockerfile to use for build. Defaults to the file Dockerfile, but if per-arch dockerfiles exist, (e.g. for x86_64 the filename would be Dockerfile_x86_64) that is used instead.
TESTCMD
The command to run for testing the image after build. Runs in a bash shell.
VERSION
The version of the app/tool, may need to be preset before starting the build (e.g. for binaries from github releases), or extracted from the image after build (e.g. for APK or pip packages).
REGISTRY
The registry to push to, defaults to the Docker Hub Registry (docker.io) or any custom registry that is set via docker configurations. Does not need to be changed for local or test builds, but to override, either pass it by setting an environment variable, or with every make command.
ORGNAME
The organization (or user) name under which the image repositories exist, defaults to woahbase. Does not need to be changed for local or test builds, but to override, either pass it by setting an environment variable, or with every make command.
The image may also require custom parameters (like binary architecture). Before you build, check the makefile for a complete list of parameters to see what may (or may not) need to be set.
BuildX and Self-signed certificates
If you're using a private registry (a-la docker distribution server) with self-signed certificates, that fail to validate when pulling/pushing images. You will need to configure buildx to allow insecure access to the registry. This is configured via the config.toml file. A sample is provided in the repository, make sure to replace YOUR.PRIVATE.REGISTRY with your own (include port if needed).
Running the image creates a container and either starts a service (for service images) or provides a shell (can be either a root-shell or usershell) to execute commands in, depending on the image. We can run the image with
makerun
But if we just need a root-shell in the container without any fance pre-tasks (e.g. for debug or to test something bespoke), we can run bash in the container with --entrypoint /bin/bash. This is wrapped in the makefile as
makeshell
Nothing vs All vs Run vs Shell
By default, if make is run without any arguments, it calls the target all. In our case this is usually mapped to the target run (which in turn may be mapped to shell).
There may be more such targets defined as per the usage of the image. Check the makefile for more information.
If the build and test steps finish without any error, and we want to use the image on other machines, it is the next step push the image we built to a container image repository (like /hub), for that, run the push target with
makepush
If the built image targets another architecture then it is required to specify the ARCH parameter when pushing. e.g.
makepushARCH=aarch64
makepushARCH=armhf
makepushARCH=armv7l
makepushARCH=i386
makepushARCH=ppc64le
makepushARCH=s390x
makepushARCH=x86_64
Pushing Multiple Tags
With a single make push, we are actually pushing 3 tags of the same image, e.g. for x86_64 architecture, they're namely
alpine-influxdb:x86_64
The actual image that is built.
alpine-influxdb:x86_64_${version}
It is expected that the application is versioned when built or packaged, it can be specified in the tag, this makes pulling an image by tag possible. Usually this is obtained from the parameter VERSION, which by default, is set by calling a function to extract the version string from the package installed in the container, or from github releases. Can be skipped with the parameter SKIP_VERSIONTAG to a non-empty string value like 1.
alpine-influxdb:x86_64_${version}_${builddate}
When building multiple versions of the same image (e.g. for providing fixes or revisions), this ensures that a more recent push does not fully replace a previously pushed image. This way, although the architecture and version tags are replaced, it is possible to roll back to the previously built image by build date (format yyyymmdd). This value is obtained from the BUILDDATE parameter, and if not essential, can be skipped by setting the parameter SKIP_BUILDDATETAG to a non-empty string value like 1.
Pushing To A Private Registry
If you want to push the image to a custom registry that is not pre-configured on your system, you can set the REGISTRY variable either on the build environment, or as a makefile parameter, and that will be used instead of the default Docker Hub repository. Make sure to have push access set up before you actually push, and include port if needed. E.g.
For single architecture images, the above should suffice, the built image can be used in the host machine, and on other machines that have the same architecture too, i.e. after a push.
But for use-cases that need to support multiple architectures, there's a couple more things that need to be done. We need to create (or amend if already created beforehand) a manifest for the image(s) that we built, then annotate it to map the images to their respective architectures. And for our three tags created above we need to do it thrice.
Did you know?
We can inspect the manifest of any image by running
Assuming we built the images for all supported architectures, to facilitate pulling the correct image for the architecture, we can create/amend the latest manifest and annotate it to map the tags :aarch64, :armhf, :armv7l, :i386, :ppc64le, :s390x, :x86_64 to the tag :latest by running
makeannotate_latest
How it works
First we create or amend the manifest with the tag latest
Next, to facilitate pulling images by version, we create/amend the image-version manifest and annotate it to map the tags :aarch64_${version}, :armhf_${version}, :armv7l_${version}, :i386_${version}, :ppc64le_${version}, :s390x_${version}, :x86_64_${version} to the tag :${version} by running
makeannotate_version
How it works
First we create or amend the manifest with the tag ${version}
Then, (optionally) we create/amend the ${version}_${builddate} manifest and annotate it to map the tags :aarch64_${version}_${builddate}, :armhf_${version}_${builddate}, :armv7l_${version}_${builddate}, :i386_${version}_${builddate}, :ppc64le_${version}_${builddate}, :s390x_${version}_${builddate}, :x86_64_${version}_${builddate} to the tag :${version}_${builddate} by running
makeannotate_date
How it works
First we create or amend the manifest with the tag ${version}_${builddate}
Maintained (or sometimes a lack thereof?) by WOAHBase.
Helped you save a bit of your valuable time and effort that is best spent doing stuff you actually enjoy? If you have some pocket-change to spare, kindly consider helping out.