Browse Source

docker build stage: revert user after applying `chown` workaround for inter-stage copy

Fabian Peter Hammerle 3 years ago
parent
commit
bf7ed283d2
2 changed files with 5 additions and 0 deletions
  1. 2 0
      CHANGELOG.md
  2. 3 0
      Dockerfile

+ 2 - 0
CHANGELOG.md

@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
 
 ## [Unreleased]
+### Changed
+- docker build stage: revert user after applying `chown` workaround for inter-stage copy
 
 ## [0.4.0] - 2020-09-10
 ### Added

+ 3 - 0
Dockerfile

@@ -4,6 +4,7 @@ ARG BASE_IMAGE=alpine:3.11
 ARG SOURCE_DIR_PATH=/systemctl-mqtt
 
 
+# hadolint ignore=DL3006
 FROM $BASE_IMAGE as build
 
 RUN apk add --no-cache \
@@ -38,8 +39,10 @@ RUN pipenv install --deploy --verbose \
 # > failed to copy files: failed to copy directory: Error processing tar file(exit status 1): Container ID ... cannot be mapped to a host ID
 USER 0
 RUN chown -R 0:0 $SOURCE_DIR_PATH
+USER build
 
 
+# hadolint ignore=DL3006
 FROM $BASE_IMAGE
 
 RUN apk add --no-cache \