loopbackio / loopbackio/loopback-next
Use FQIN in Dockerfile
- Dominant language
- TypeScript
- Stars
- 5.1k
- Forks
- 1.1k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 27
Description
Historically, we have used Unqualified Image Names. However, this is insecure as it is ambiguous on registry to use. Fully Qualified Image Names (FQIN) make explicit the domain name of the registry to pull from.
## Change details
For `Dockerfile`s, the general update will be:
```diff
+ FROM docker.io/library/node:18-slim
- FROM node:18-slim
```
Although there is special-handling for the `docker.io` registry that allows omission of `/library` namespace path prefix for "no-namespace" images, we should use the full FQIN so as to be consistent with the output of other utilities such as `podman image ls`.
## Impact
Other than updated `Dockerfile`s, there should be no other noticeable impact.
## Files to update
- `loopback-next`
- [docs/site/Application-generator.md](https://github.com/loopbackio/loopback-next/blob/553cfb173ece664e0d25f029f2ac27eeaef89897/docs/site/Application-generator.md?plain=1#L118)
- [examples/access-control-migration/Dockerfile](https://github.com/loopbackio/loopback-next/blob/553cfb173ece664e0d25f029f2ac27eeaef89897/examples/access-control-migration/Dockerfile#L2)
- [examples/multi-tenancy/Dockerfile](https://github.com/loopbackio/loopback-next/blob/553cfb173ece664e0d25f029f2ac27eeaef89897/examples/multi-tenancy/Dockerfile#L2)
- [examples/references-many/Dockerfile](https://github.com/loopbackio/loopback-next/blob/553cfb173ece664e0d25f029f2ac27eeaef89897/examples/references-many/Dockerfile#L2)
- [examples/rest-crud/Dockerfile](https://github.com/loopbackio/loopback-next/blob/553cfb173ece664e0d25f029f2ac27eeaef89897/examples/rest-crud/Dockerfile#L2)
- [examples/socketio/Dockerfile](https://github.com/loopbackio/loopback-next/blob/553cfb173ece664e0d25f029f2ac27eeaef89897/examples/socketio/Dockerfile#L2)
- [examples/todo/Dockerfile](https://github.com/loopbackio/loopback-next/blob/553cfb173ece664e0d25f029f2ac27eeaef89897/examples/todo/Dockerfile#L2)
- [examples/todo-jwt/Dockerfile](https://github.com/loopbackio/loopback-next/blob/553cfb173ece664e0d25f029f2ac27eeaef89897/examples/todo-jwt/Dockerfile#L2)
- [examples/todo-list/Dockerfile](https://github.com/loopbackio/loopback-next/blob/553cfb173ece664e0d25f029f2ac27eeaef89897/examples/todo-list/Dockerfile#L2)
- [packages/cli/generators/app/templates/Dockerfile](https://github.com/loopbackio/loopback-next/blob/553cfb173ece664e0d25f029f2ac27eeaef89897/packages/cli/generators/app/templates/Dockerfile#L4)
- `create-loopback`
- [templates/app/Dockerfile](https://github.com/loopbackio/create-loopback/blob/650ce5fe7d021b53e461af2994c9f0669aa3b23d/templates/app/Dockerfile#L2)
- `loopback4-example-shopping`
- [bin/dockerize.js](https://github.com/loopbackio/loopback4-example-shopping/blob/af15cf5e6a5d309c61da2ee9e522533ee9def980/bin/dockerize.js#L69-L107)
- [Dockerfile.monorepo](https://github.com/loopbackio/loopback4-example-shopping/blob/af15cf5e6a5d309c61da2ee9e522533ee9def980/Dockerfile.monorepo#L4)
- [Dockerfile.recommender](https://github.com/loopbackio/loopback4-example-shopping/blob/af15cf5e6a5d309c61da2ee9e522533ee9def980/Dockerfile.recommender#L6)
- [Dockerfile.shopping](https://github.com/loopbackio/loopback4-example-shopping/blob/af15cf5e6a5d309c61da2ee9e522533ee9def980/Dockerfile.shopping#L5)
- `loopback-blog`
- [blog/2019/2019-07-24-building-an-online-game-with-loopback-4-pt5.md](https://github.com/loopbackio/loopback-blog/blob/e7043a3870b8c58c22883f5608b1e2d5e5cd630a/blog/2019/2019-07-24-building-an-online-game-with-loopback-4-pt5.md?plain=1#L58)
- `starter`
- [Dockerfile](https://github.com/loopbackio/starter/blob/1861e2284ad3bb054fa69f2e7dba3e7c9153ed85/Dockerfile#L2)
## References
- https://github.com/search?q=org%3Aloopbackio%20language%3ADockerfile&type=code
- https://github.com/search?q=org%3Aloopbackio+%22FROM+node%3A%22&type=code
- https://github.com/containers/image/blob/95a2847696c8583d5bed0ce71fed3a32276aa870/docs/containers-registries.conf.5.md#note-risk-of-using-unqualified-image-names
### Similar changes in other projects
- https://github.com/NetApp/trident/pull/690
- https://github.com/ceph/ceph-csi/pull/1715
- https://github.com/hedgedoc/container/pull/437
Contributor guide
Research direction
Review the listed Dockerfiles, Dockerfile templates, documentation, and bin/dockerize.js across the named repositories, starting with the referenced lines and the repository-wide search links. Update each affected image reference consistently, then search the listed repositories again to confirm the targeted unqualified references are gone; the issue states that no other behavior should change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, dockerfile
- Domain
- devops, infrastructure
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 38/100