use multi-stage build
This commit is contained in:
parent
158bb31b77
commit
921ba54152
18
Dockerfile
18
Dockerfile
@ -12,18 +12,14 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
FROM golang:1.10-alpine
|
FROM golang:1.10-alpine AS build
|
||||||
|
|
||||||
VOLUME /config
|
|
||||||
EXPOSE 6060 6061
|
|
||||||
|
|
||||||
ADD . /go/src/github.com/coreos/clair/
|
ADD . /go/src/github.com/coreos/clair/
|
||||||
WORKDIR /go/src/github.com/coreos/clair/
|
WORKDIR /go/src/github.com/coreos/clair/
|
||||||
|
RUN go build github.com/coreos/clair/cmd/clair
|
||||||
|
|
||||||
RUN apk add --no-cache git rpm xz dumb-init && \
|
FROM alpine:3.8
|
||||||
go install -v github.com/coreos/clair/cmd/clair && \
|
COPY --from=build /go/src/github.com/coreos/clair/clair /clair
|
||||||
mv /go/bin/clair /clair && \
|
RUN apk add --no-cache git rpm xz ca-certificates dumb-init
|
||||||
rm -rf /go /usr/local/go
|
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/bin/dumb-init", "--", "/clair"]
|
ENTRYPOINT ["/usr/bin/dumb-init", "--", "/clair"]
|
||||||
|
VOLUME /config
|
||||||
|
EXPOSE 6060 6061
|
||||||
|
Loading…
Reference in New Issue
Block a user