devcontainers / devcontainers/templates

Presence of Dockerfile in spec-provided Templates

Open
#135 9 comments 2 reactions 1 assignee Claimed by @bamurtaugh View on GitHub
Dominant language
Shell
Stars
1.4k
Forks
393
Avg merge
2h 3m
Merged PRs (30d)
1

Description

## Context

Before opening the dev container spec, we hosted a set of dev container Templates that each included a Dockerfile and devcontainer.json. Once we opened up the spec, we moved a set of Templates to this repo, and we made some changes, including having each Template only include a devcontainer.json in the .devcontainer folder ([example](https://github.com/devcontainers/templates/tree/main/src/alpine/.devcontainer)).

Our goal was to make things simpler: you don't need to be a Dockerfile expert to use dev containers, and dev containers can be as simple as just a devcontainer.json referencing an image. The spec also still supports using a Dockerfile, so this change didn't break existing setups using a Dockerfile.

## Problem

We've started seeing feedback ([example](https://github.com/devcontainers/templates/issues/77)) that the lack of Dockerfile (in this repo, or when running "Add Dev Container Configuration Files" in a supporting tool like VS Code or GitHub Codespaces) is confusing, with questions such as:
- Are Dockerfiles supported by the dev container spec?
- Has something changed (since the previous Templates had them)?
- How do I add a Dockerfile?

## Potential solutions

We added a [comment](https://github.com/devcontainers/templates/blob/main/src/alpine/.devcontainer/devcontainer.json#L5) in the Templates to try to help clarify: `/ Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile`. But, we'd like to discuss making this an even clearer / easier process.

There are a few ways to address this, including:
- Add Dockerfiles back to Templates in this repo
- Add an option to "Add Dockerfile" in the "Add Dev Container Configuration Files" command flow in supporting tools
- Could be a new step in the series of quick picks, or a checkbox in an existing step

## Next steps
Share this issue with the community, including [existing issues](https://github.com/devcontainers/templates/issues/77) and our dev container community [Slack channel](https://github.com/devcontainers/community/discussions/3), to get broader feedback.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.