Installation
Package Managers¶
This section describes the installation of gotmpl in a native environment.
Tip
If you want to install it in a Dockerfile follow our Docker instructions to create minimal images.
apk (Alpine)¶
apk¶
deb (Debian/Ubuntu)¶
apt¶
rpm (RHEL/CentOS/Fedora)¶
dnf¶
yum¶
Docker¶
If you want to install this tool to use it in a container follow these instructions to achieve minimal images.
Warning
Compact is preferred since it creates only one layer, Detailed is only for explanation.
Tip
For building images we recommend pinning versions to have stable results.
apk¶
# Set to install fixed fixed specific version
ARG GOTMPL_VERSION=0.0.0
# Install dependencies (optional - your base image might already contain them)
RUN apk add --no-cache curl bash
# Setup our package repository
RUN curl -1sLf 'https://dl.cloudsmith.io/basic/gotmpl/gotmpl/setup.deb.sh' | bash
# Install gotmpl
RUN apk add --no-cache gotmpl==$GOTMPL_VERSION
apt¶
# Set to install fixed fixed specific version
ARG GOTMPL_VERSION=0.0.0
# Install dependencies (optional - your base image might already contain them)
RUN apt-get update && \
apt-get install -y --no-install-recommends curl bash && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Setup our package repository
RUN curl -1sLf 'https://dl.cloudsmith.io/basic/gotmpl/gotmpl-test/setup.deb.sh' | bash
# Install gotmpl
RUN apt-get update && \
apt-get install -y --no-install-recommends gotmpl==$GOTMPL_VERSION
apt-get clean && \
rm -rf /var/lib/apt/lists/*
dnf¶
# Set to install fixed specific version
ARG GOTMPL_VERSION=0.0.0
# Install dependencies (optional - your base image might already contain them)
RUN dnf install -y --setopt=install_weak_deps=false curl bash && \
dnf clean all && \
rm -rf /var/cache/yum
# Setup our package repository
RUN curl -1sLf 'https://dl.cloudsmith.io/basic/gotmpl/gotmpl-test/setup.rpm.sh' | bash
# Install gotmpl
RUN dnf install -y --setopt=install_weak_deps=false gotmpl==$GOTMPL_VERSION && \
dnf clean all && \
rm -rf /var/cache/yum
microdnf¶
# Set to install fixed specific version
ARG GOTMPL_VERSION=0.0.0
# Install dependencies (optional - your base image might already contain them)
RUN microdnf install -y --setopt=install_weak_deps=false curl bash && \
microdnf clean all && \
rm -rf /var/cache/yum
# Setup our package repository
RUN curl -1sLf 'https://dl.cloudsmith.io/basic/gotmpl/gotmpl-test/setup.rpm.sh' | bash
# Install gotmpl
RUN microdnf install -y --setopt=install_weak_deps=false gotmpl==$GOTMPL_VERSION && \
microdnf clean all && \
rm -rf /var/cache/yum
yum¶
# Set to install fixed specific version
ARG GOTMPL_VERSION=0.0.0
# Install dependencies (optional - your base image might already contain them)
RUN yum install -y --setopt=tsflags=nodocs curl bash && \
yum clean all && \
rm -rf /var/cache/yum
# Setup our package repository
RUN curl -1sLf 'https://dl.cloudsmith.io/basic/gotmpl/gotmpl-test/setup.rpm.sh' | bash
# Install gotmpl
RUN yum install -y --setopt=tsflags=nodocs gotmpl==$GOTMPL_VERSION && \
yum clean all && \
rm -rf /var/cache/yum
GitHub¶
We release our packages via GitHub Releases and you can install them by downloading (and validating) them directly from there.
Note
This is only recommended if your operating system does not support the package managers above.
Linux:
VERSION=0.0.0 ARCH=amd64; wget -O - https://github.com/gotmpl/gotmpl/releases/download/$VERSION/gotmpl-$VERSION-linux-$ARCH.tar.gz | tar xzf - -C /usr/local/bin
Linux (alpine):
VERSION=0.0.0 ARCH=amd64; wget -O - https://github.com/gotmpl/gotmpl/releases/download/$VERSION/gotmpl-$VERSION-linux-$ARCH-musl.tar.gz | tar xzf - -C /usr/local/bin
Go¶
The tool can also be installed via go CLI.
Warning
This is not recommended and should typically be used for development purposes only.
Tip
To build the CLI tool with Go, make sure you have Go installed (version 1.25 or newer recommended).
Build from Source¶
The tool can also be installed by building it directly from source.
Tip
To build the CLI tool from source, make sure you have Go installed (version 1.25 or newer recommended).
-
Clone the repository:
-
Build the binary:
-
(Optional) Move the binary to a directory in your
PATH: