Browse Source

test-docker-slim

test-docker-slim
fedy95 4 years ago
parent
commit
e5196ce572
  1. 11
      Makefile
  2. 11
      image/Dockerfile.final

11
Makefile

@ -5,10 +5,17 @@ MAKEFLAGS += --silent
YAMLLINT_TAG=latest YAMLLINT_TAG=latest
build_yamllint: build_yamllint:
docker build -t fedy95/baseimage:yamllint-${YAMLLINT_TAG} image -f image/Dockerfile
#docker build -t fedy95/baseimage:yamllint-${YAMLLINT_TAG} image -f image/Dockerfile
# docker pull dslim/docker-slim:latest
#-v /var/run/docker.sock:/var/run/docker.sock
docker run --rm --volume /var/run/docker.sock:/var/run/docker.sock dslim/docker-slim:latest build \
--http-probe=false \
--tag=fedy95/baseimage:yamllint-${YAMLLINT_TAG} fedy95/baseimage:yamllint-${YAMLLINT_TAG} --help
# docker run --rm -v /var/run/docker.sock:/var/run/docker.sock dslim/docker-slim:latest build --http-probe=false fedy95/baseimage:yamllint-${YAMLLINT_TAG}
lint: lint:
@docker run --rm $$(tty -s && echo "-it" || echo) -v $(PWD):/data fedy95/baseimage:yamllint-latest .
@docker run --rm $$(tty -s && echo "-it" || echo) -v $(PWD):/data fedy95/baseimage:yamllint-latest . && ls -lah /
lint_help: lint_help:
docker run --rm -v $(pwd):/data fedy95/baseimage:yamllint-latest --help docker run --rm -v $(pwd):/data fedy95/baseimage:yamllint-latest --help

11
image/Dockerfile.final

@ -0,0 +1,11 @@
FROM debian:bullseye-slim
RUN apt-get update && \
apt-get install -y yamllint && \
rm -rf /var/lib/apt/lists/*
COPY relaxed.yaml /yamllint/relaxed.yaml
WORKDIR /data
ENTRYPOINT ["yamllint", "-c", "/yamllint/relaxed.yaml"]
CMD ["--help"]