Este producto no es compatible con el sitio Datadog seleccionado. ().
Esta página aún no está disponible en español. Estamos trabajando en su traducción.
Si tienes alguna pregunta o comentario sobre nuestro actual proyecto de traducción, no dudes en ponerte en contacto con nosotros.

Metadata

ID: docker-best-practices/curl-or-wget

Language: Docker

Severity: Warning

Category: Best Practices

Description

This rule enforces the use of either wget or curl exclusively within a Dockerfile, but not both. Mixing these two tools in the same Dockerfile can lead to unnecessary complexity and larger image sizes due to installing multiple similar utilities. It also reduces consistency and maintainability of the Dockerfile.

To comply with this rule, choose either wget or curl based on your preference or the base image’s default availability, and use it consistently throughout your Dockerfile. For example, if you decide to use curl, replace all occurrences of wget with equivalent curl commands like curl -O <url>. This approach ensures clarity and reduces the image footprint.

Non-Compliant Code Examples

FROM debian
RUN curl http://bing.com
ADD something somethingelse
RUN wget http://google.com
FROM debian
RUN wget http://google.com
ADD something somethingelse
RUN curl http://bing.com

Compliant Code Examples

FROM debian
RUN curl http://google.com
RUN curl http://bing.com
https://static.datadoghq.com/static/images/logos/github_avatar.svg https://static.datadoghq.com/static/images/logos/vscode_avatar.svg jetbrains

Integraciones sin problemas. Prueba Datadog Code Security