Install tools in Docker image
Please see the document.
https://aquaproj.github.io/docs/tutorial-extras/build-container-image
aqua-docker is a CLI installing CLIs in Docker images.
aqua-docker assumes that installed CLIs work as a single executable file. So some tools such as tfenv can't be supported.
- Docker
Please run aqua-docker by go run
command in Dockerfile.
e.g. Install actionlint and reviewdog with aqua-docker.
aqua.yaml
registries:
- type: standard
ref: v3.18.0 # renovate: depName=aquaproj/aqua-registry
packages:
- name: rhysd/[email protected]
- name: reviewdog/[email protected]
Dockerfile
FROM golang:1.18.4 AS aqua
COPY aqua.yaml /aqua.yaml
RUN go run github.com/aquaproj/[email protected] --aqua-version v1.17.1 --config /aqua.yaml --dest /dist actionlint reviewdog
FROM alpine:latest
RUN apk --no-cache add ca-certificates
COPY --from=aqua /dist/* /usr/local/bin/
Build an image.
$ docker build -t foo .
Let's confirm if tools are installed.
$ docker run --rm -ti foo sh
/ # reviewdog -version
0.14.1
/ # actionlint -version
1.6.15
installed by downloading from release page
built with go1.18.3 compiler for linux/arm64
/ # which reviewdog
/usr/local/bin/reviewdog
/ # which actionlint
/usr/local/bin/actionlint
/ # which aqua # aqua isn't installed
/ #
- Install aqua
- Run
aqua i
- Create a directory (By default, the directory path is
dist
, but you can change this by-dest
option) and copy files at the directory