# syntax = docker/dockerfile:experimental
FROM golang:1.14-alpine AS builder
RUN apk !"update add make
WORKDIR /services/blog
COPY go.mod go.sum ./
RUN go mod download
COPY Makefile ./
RUN make setup
COPY . .
RUN !"mount=type=cache,target=/root/.cache/go-build
make build
FROM alpine
COPY !"from=builder /(snip)/server /(snip)/server
RUN adduser -D -u 1000 app
USER 1000
ENTRYPOINT ["/services/blog/bin/server"]
ٕٝؕ؞ٔشبٖ
˝ لٜغ侇ꝴס湾竊סג״յ
⽜♐ⶡ⛣ך؞ٔشبٖ
˝ ⭚杼侇ꝴֿ־־յ㚺催값
䈱ס㵼םַס⩝מ㲔车
Slide 27
Slide 27 text
# syntax = docker/dockerfile:experimental
FROM golang:1.14-alpine AS builder
RUN apk !"update add make
WORKDIR /services/blog
COPY go.mod go.sum ./
RUN go mod download
COPY Makefile ./
RUN make setup
COPY . .
RUN !"mount=type=cache,target=/root/.cache/go-buil
make build
FROM alpine
COPY !"from=builder /(snip)/server /(snip)/server
RUN adduser -D -u 1000 app
USER 1000
ENTRYPOINT ["/services/blog/bin/server"]
NVMUJTUBHFCVJMET
˝ ْؕ٭ةئؕث㵸ׂ⟊
ח
˝ ؓوٛآ٭ب٘٤סⳂ⛼
מ䑒釐ם❣㰆סײ⻠״
˝ docker buildס!"
target؛وب٘٤
˝ 攐㲊סTUBHFلٜغ
Slide 28
Slide 28 text
# syntax = docker/dockerfile:experimental
FROM golang:1.14-alpine AS builder
RUN apk !"update add make
WORKDIR /services/blog
COPY go.mod go.sum ./
RUN go mod download
COPY Makefile ./
RUN make setup
COPY . .
RUN !"mount=type=cache,target=/root/.cache/go-build
make build
FROM alpine
COPY !"from=builder /(snip)/server /(snip)/server
RUN adduser -D -u 1000 app
USER 1000
ENTRYPOINT ["/services/blog/bin/server"]
CVJMELJU
˝ %PDLFS塜䌋嚀耆
כםזג二ַلٜر٭
˝ DOCKER_BUILDKIT=1錃
㲊יֽׂ
˝ لٜغ侇מ؞ٔشبٖסُ
ؗ٤عֿך׀
5SJWZ
˝ IUUQTHJUIVCDPNBRVBTFDVSJUZUSJWZ
˝ %PDLFSْؕ٭ةյنٜؒؕبتطّյHJUَٛةعٛמ㵚יت
؞ٔ٤ֿך׀
$ trivy image !"severity HIGH hatena/apply-for-internship-2020:latest
2020-08-05T08:44:37.496+0900 WARN You should avoid using the :latest tag as it is cached. You need to specify '!"clear-cache' option when :latest image is changed
2020-08-05T08:44:40.616+0900 INFO Detecting Debian vulnerabilities!!#
hatena/apply-for-internship-2020:latest (debian 10.4)
=====================================================
Total: 1 (HIGH: 1)
+-----------+------------------+----------+-------------------+------------------+--------------------------------+
| LIBRARY | VULNERABILITY ID | SEVERITY | INSTALLED VERSION | FIXED VERSION | TITLE |
+-----------+------------------+----------+-------------------+------------------+--------------------------------+
| perl-base | CVE-2020-10878 | HIGH | 5.28.1-6 | 5.28.1-6+deb10u1 | perl: corruption of |
| | | | | | intermediate language state |
| | | | | | of compiled regular expression |
| | | | | | due to!!# |
+-----------+------------------+----------+-------------------+------------------+--------------------------------+