How to fix Dockerfile parse error line 10: MAINTAINER is deprecated in Docker
This warning appears when Docker encounters the deprecated MAINTAINER instruction in your Dockerfile. Replace it with the LABEL instruction using the org.opencontainers.image.authors key to specify maintainer metadata following modern OCI standards.
Quick fix
Fixes Dockerfile parse error line 10: MAINTAINER is deprecated
FROM ubuntu:22.04
MAINTAINER John Doe <john@example.com>- Locate the MAINTAINER instruction
- Replace MAINTAINER with LABEL
- Handle multiple maintainers
- Add additional OCI labels (optional)
FROM ubuntu:22.04MAINTAINER John Doe <john@example.com>Dockerfile parse error line 10: MAINTAINER is deprecated
What this error means
The MAINTAINER instruction was historically used in Dockerfiles to specify the author or maintainer of an image. However, this instruction has been deprecated since Docker 1.13.0 in favor of the more flexible LABEL instruction. When Docker parses your Dockerfile and encounters MAINTAINER, it will display a deprecation warning. While the build may still succeed, the warning indicates you're using an outdated practice that may be removed in future Docker versions. The deprecation exists because LABEL provides a standardized, more powerful approach to image metadata. Unlike MAINTAINER (which only accepts a single string), LABEL supports arbitrary key-value pairs, follows the OCI (Open Container Initiative) specification, and can be easily queried using `docker inspect`.
Typical symptoms
- Build outputs warning: 'MAINTAINER is deprecated'
- Linters like hadolint flag the MAINTAINER instruction
- CI/CD pipelines fail due to Dockerfile validation rules
- Code review tools mark MAINTAINER as deprecated
- Docker build checks show MaintainerDeprecated warning
Common causes
- Using the legacy MAINTAINER instruction in Dockerfile
- Dockerfile was created before Docker 1.13.0 when MAINTAINER was standard
- Copying older Dockerfile examples from outdated documentation or tutorials
- Using base images or Dockerfile templates that haven't been updated
How to fix "Dockerfile parse error line 10: MAINTAINER is deprecated"
First, find the MAINTAINER line in your Dockerfile. It typically appears near the top, after the FROM instruction:
FROM ubuntu:22.04
MAINTAINER John Doe <john@example.com>You can search for it with:
grep -n "MAINTAINER" DockerfileReplace the MAINTAINER instruction with LABEL using the standardized OCI key for author information.
Before (deprecated):
FROM ubuntu:22.04
MAINTAINER John Doe <john@example.com>After (recommended - OCI standard):
FROM ubuntu:22.04
LABEL org.opencontainers.image.authors="John Doe <john@example.com>"Alternative (simpler):
FROM ubuntu:22.04
LABEL maintainer="john@example.com"The OCI standard (org.opencontainers.image.authors) is preferred for maximum compatibility with container tools and registries.
If you have multiple maintainers, include them in a single LABEL:
LABEL org.opencontainers.image.authors="John Doe <john@example.com>, Jane Smith <jane@example.com>"Or use multiple labels for different purposes:
LABEL org.opencontainers.image.authors="Team Name <team@example.com>"
LABEL org.opencontainers.image.vendor="Company Name"
LABEL org.opencontainers.image.url="https://github.com/company/project"While updating your Dockerfile, consider adding other useful OCI standard labels:
LABEL org.opencontainers.image.authors="john@example.com"
LABEL org.opencontainers.image.title="My Application"
LABEL org.opencontainers.image.description="A containerized web application"
LABEL org.opencontainers.image.version="1.0.0"
LABEL org.opencontainers.image.source="https://github.com/user/repo"
LABEL org.opencontainers.image.licenses="MIT"Or combine them in a single LABEL instruction:
LABEL org.opencontainers.image.authors="john@example.com" \
org.opencontainers.image.title="My Application" \
org.opencontainers.image.version="1.0.0"Rebuild your image to confirm the warning is gone:
docker build -t myimage:latest .You can verify the labels are set correctly:
docker inspect myimage:latest --format='{{json .Config.Labels}}' | jqOr without jq:
docker inspect myimage:latest | grep -A 10 '"Labels"'Run hadolint to check for other Dockerfile issues:
docker run --rm -i hadolint/hadolint < DockerfileAdvanced notes
### OCI Image Specification Labels
The Open Container Initiative (OCI) defines standard label keys for container image metadata. Using these ensures compatibility across container runtimes and registries:
| Label | Purpose |
|-------|---------|
| org.opencontainers.image.authors | Contact details of maintainers |
| org.opencontainers.image.title | Human-readable title |
| org.opencontainers.image.description | Human-readable description |
| org.opencontainers.image.version | Version of the packaged software |
| org.opencontainers.image.source | URL to source code |
| org.opencontainers.image.licenses | License(s) under which contained software is distributed |
| org.opencontainers.image.vendor | Name of the distributing entity |
| org.opencontainers.image.created | Date and time on which the image was built (RFC 3339) |
### Dynamic Labels at Build Time
You can set labels dynamically using build arguments:
ARG BUILD_DATE
ARG VERSION
ARG VCS_REF
LABEL org.opencontainers.image.created="${BUILD_DATE}" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.revision="${VCS_REF}"Then build with:
docker build \
--build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
--build-arg VERSION=1.0.0 \
--build-arg VCS_REF=$(git rev-parse --short HEAD) \
-t myimage:latest .### Querying Labels
Labels can be used to filter and organize images:
# Find images by author
docker images --filter "label=org.opencontainers.image.authors=john@example.com"
# List all labels for an image
docker inspect --format='{{range $k, $v := .Config.Labels}}{{$k}}={{$v}}{{println}}{{end}}' myimage:latest### Why MAINTAINER Was Deprecated
The MAINTAINER instruction had several limitations:
1. Only supported a single string value
2. Not part of the OCI specification
3. Couldn't be filtered or queried easily
4. No standardized format for the value
5. Mixing author info with other metadata wasn't possible
LABEL solves all these issues while providing a standardized, extensible approach to image metadata.
Frequently asked questions
- What does "Dockerfile parse error line 10: MAINTAINER is deprecated" mean?
- The MAINTAINER instruction was historically used in Dockerfiles to specify the author or maintainer of an image. 0 in favor of the more flexible LABEL instruction. When Docker parses your Dockerfile and encounters MAINTAINER, it will display a deprecation warning.
- How do I fix "Dockerfile parse error line 10: MAINTAINER is deprecated"?
- This warning appears when Docker encounters the deprecated MAINTAINER instruction in your Dockerfile. Replace it with the LABEL instruction using the org.opencontainers.image.authors key to specify maintainer metadata following modern OCI standards.
- What causes "Dockerfile parse error line 10: MAINTAINER is deprecated"?
- Using the legacy MAINTAINER instruction in Dockerfile Dockerfile was created before Docker 1.13.0 when MAINTAINER was standard Copying older Dockerfile examples from outdated documentation or tutorials
- Is the "Dockerfile parse error line 10: MAINTAINER is deprecated" error serious?
- It is a low-severity error โ more of a blocker than a risk. The steps above resolve it.
Official resources & further reading
- ๐Docker Official Documentation
- ๐MaintainerDeprecated - Docker Docs(Official Docs)
- ๐Deprecated features - Docker Docs(Official Docs)
- ๐ฌ
- ๐
- ๐
- ๐