One of the advantages of using Okteto is the ability to configure development environments as code, side by side with your application.
Instead of having to keep a wiki with a never-ending list of tools, dependencies and scripts to install and run, you just have to clone your repository, deploy your application and run
okteto up to start developing in seconds.
At a high level, a development environment is a Docker container that contains:
When you run the
okteto init command on a local repository,
okteto will analyze your source code and will guess the main programming language you’re using. Based on this, it will select a base development environment configuration and create a default
okteto.yml for you.
For example, if your repository is mostly
golang, it will look like this:
Out of the box, Okteto creates default development environments for the following languages:
The default development environments are a great way to start. They use the latest official docker image for your language runtime and include the most common developer tools. But they might not have everything you need. Your team might need to support a very specific version of your runtime, or you might need some extra tooling available.
Development environments are defined via Docker containers, so any existing Docker image can be used as a development environment.
Do the following to create your own development environment:
imagekey in your
okteto.ymlwith your new image.
Once you do that, the next time you run
okteto up, your new development environment will be deployed automatically.
Besides following Docker’s best practices, we also recommend the following:
okteto.yml. By doing this, the content of the folder will be used to initialize the file synchronization service, instead of requiring a full initial sync. This will make