Skip to content

Commit 8d3888d

Browse files
committed
add /tmp directory to scratch image
1 parent 19e79ce commit 8d3888d

4 files changed

Lines changed: 4 additions & 2 deletions

File tree

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ build_go_multi:
1313
docker buildx build --platform linux/amd64,linux/arm64 --pull -t umputun/baseimage:buildgo-latest -t ghcr.io/umputun/baseimage/buildgo:latest build.go -f build.go/Dockerfile
1414

1515
build_scratch:
16-
docker build --pull -t umputun/baseimage:scratch-latest -t ghcr.io/umputun/baseimage/scratch:latest build.go -f base.scratch/Dockerfile
16+
docker build --pull -t umputun/baseimage:scratch-latest -t ghcr.io/umputun/baseimage/scratch:latest base.scratch -f base.scratch/Dockerfile
1717

1818
build_scratch_multi:
19-
docker buildx build --platform linux/amd64,linux/arm64 --pull -t umputun/baseimage:scratch-latest -t ghcr.io/umputun/baseimage/scratch:latest build.go -f base.scratch/Dockerfile
19+
docker buildx build --platform linux/amd64,linux/arm64 --pull -t umputun/baseimage:scratch-latest -t ghcr.io/umputun/baseimage/scratch:latest base.scratch -f base.scratch/Dockerfile
2020

2121
.PHONY: all

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ Image `ghcr.io/umputun/baseimage/scratch:latest` (or `umputun/baseimage:scratch-
104104
- zoneinfo to allow change the timezone of the running application using the `TZ` environment variable
105105
- SSL certificates (ca-certificates)
106106
- `/etc/passwd` and `/etc/groups` with `app` user and group added (UID:1001, GID:1001)
107+
- `/tmp` directory with sticky bit permissions (1777), writable by any user
107108
- `/nop` program to wait forever and do nothing
108109

109110
Container sets user to `app` and working directory to `/srv`, no entrypoint set. In order to change time zone `TZ` env can be used.

base.scratch/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ COPY --from=prep /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
2121
COPY --from=prep /etc/passwd /etc/passwd
2222
COPY --from=prep /etc/group /etc/group
2323
COPY --from=prep /tmp/nop /nop
24+
ADD tmp.tar /
2425

2526
USER app
2627
WORKDIR /srv

base.scratch/tmp.tar

3.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)