Skip to content

Commit 5a14998

Browse files
committed
Fix Docker setup
We have been tripped by unwanted cache hits when automatically building Docker images.
1 parent 9e7b76f commit 5a14998

File tree

3 files changed

+27
-11
lines changed

3 files changed

+27
-11
lines changed

.dockerignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*
2+
!etc
3+
!mqttwarn
4+
!tests
5+
!setup.py
6+
!MANIFEST.in
7+
!*.ini
8+
!*.md
9+
!*.rst

CHANGES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ mqttwarn changelog
66
in progress
77
===========
88

9+
- [build] Fix unwanted cache hits when automatically building Docker images
10+
911

1012
2021-06-03 0.21.0
1113
=================

Dockerfile

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,32 @@
1+
# Docker build file for mqttwarn.
2+
# Based on https://github.com/pfichtner/docker-mqttwarn.
3+
#
4+
# Invoke like:
5+
#
6+
# docker build --tag=mqttwarn-local .
7+
#
18
FROM python:3.9-slim-buster
29

3-
# based on https://github.com/pfichtner/docker-mqttwarn
10+
# Install mqttwarn
11+
COPY . /src
12+
RUN pip install /src
413

5-
# install mqttwarn
6-
RUN pip install mqttwarn
7-
8-
# create /etc/mqttwarn
14+
# Create /etc/mqttwarn
915
RUN mkdir -p /etc/mqttwarn
1016
WORKDIR /etc/mqttwarn
1117

12-
# add user mqttwarn to image
18+
# Add user "mqttwarn"
1319
RUN groupadd -r mqttwarn && useradd -r -g mqttwarn mqttwarn
1420
RUN chown -R mqttwarn:mqttwarn /etc/mqttwarn
1521

16-
# process run as mqttwarn user
22+
# Make process run as "mqttwarn" user
1723
USER mqttwarn
1824

19-
# conf file from host
25+
# Use configuration file from host
2026
VOLUME ["/etc/mqttwarn"]
2127

22-
# set conf path
28+
# Set default configuration path
2329
ENV MQTTWARNINI="/etc/mqttwarn/mqttwarn.ini"
2430

25-
# run process
31+
# Invoke program
2632
CMD mqttwarn
27-

0 commit comments

Comments
 (0)