-
Notifications
You must be signed in to change notification settings - Fork 14
/
Dockerfile-dev
29 lines (22 loc) · 1.13 KB
/
Dockerfile-dev
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Copyright (c) Mondoo, Inc.
# SPDX-License-Identifier: BUSL-1.1
# Mondoo Multi-Architecture Container Dockerfile
#
# To build root images with BuildX: docker buildx build --build-arg VERSION=5.21.0 --platform
# linux/386,linux/amd64,linux/arm/v7,linux/arm64 --target root -t mondoolabs/mondoo:5.21.0 . --push
#
# To build rootless images with BuildX: docker buildx build --build-arg VERSION=5.21.0 --platform
# linux/386,linux/amd64,linux/arm/v7,linux/arm64 --target rootless -t mondoolabs/mondoo:5.21.0 . --push
ARG VERSION
FROM docker.io/mondoo/cnspec:${VERSION} AS root
WORKDIR /mnt
RUN ln -s /usr/local/bin/cnspec /usr/local/bin/mondoo
# force the installation of all providers that the linter needs
RUN touch empty.mql.yaml && cnspec bundle lint empty.mql.yaml && rm $(find /opt/mondoo/providers -not -name "*.json" -type f)
RUN mkdir -p /home/mondoo/.config/mondoo && echo "auto_update: false" > /home/mondoo/.config/mondoo/mondoo.yaml
ENTRYPOINT [ "cnspec" ]
CMD ["bundle", "lint"]
# Rootless version of the container
FROM root AS rootless
RUN addgroup -S mondoo && adduser -S -G mondoo mondoo
USER mondoo