Dockerfiles should specify a base image

이 페이지는 아직 한국어로 제공되지 않으며 번역 작업 중입니다. 번역에 관한 질문이나 의견이 있으시면 언제든지 저희에게 연락해 주십시오.

Metadata

ID: docker-best-practices/no-from-image

Language: Docker

Severity: Warning

Category: Best Practices

Description

The rule stipulates that all Dockerfiles must specify a base image. This is important because without specifying a base image, you are building a container from scratch, and this is likely what is not intended.

To avoid violating this rule, always declare a base image at the start of your Dockerfile using the FROM keyword. For example, FROM ubuntu:18.04 sets the base image to Ubuntu 18.04.

Non-Compliant Code Examples

RUN echo "hello"

Compliant Code Examples

FROM image as base

# foo

FROM image2
https://static.datadoghq.com/static/images/logos/github_avatar.svg https://static.datadoghq.com/static/images/logos/vscode_avatar.svg jetbrains

Seamless integrations. Try Datadog Code Analysis

PREVIEWING: rtrieu/product-analytics-ui-changes