Discover reasons why top companies like Replicated buy instead of build their dev platform
Watch the Webinar Recording

BuildKit as a Service in Okteto Cloud

We are thrilled to announce that you can now build Docker images from your local source code directly in Okteto Cloud, all powered by BuildKit. Another reason to remove Docker and Kubernetes from your laptop and develop directly in Kubernetes!

Why should I build my images on remote?

BuildKit is one of the most amazing projects out there. It lets us build Docker images faster and more securely than ever. But no matter how fast BuildKit is, if you are building Docker images, you still need to pull your base images and push the new images to the registry before updating your applications. Depending on your network connection, this process can take minutes. And you need Docker running locally, consuming CPU cycles, memory and battery.

Our new BuildKit as Service feature lets you build your images directly in Okteto Cloud, dramatically cutting down your build times, independently of your network connection. And since it's powered by BuildKit, it'll just work with your existing Dockerfiles and Docker registries.

How do I use it?

If you haven't done it yet, you need to install the Okteto CLI and run okteto context. From that moment, you get full access to run remote builds in Okteto Cloud via the okteto build command:

$ okteto build -t okteto/hello-world:golang .
[+] Building 3.0s (16/16) FINISHED
 => importing cache manifest from okteto/hello-world:golang                         1.2s
 => [internal] load .dockerignore                                                   0.1s
 => => transferring context: 2B                                                     0.1s
 => [internal] load build definition from Dockerfile                                0.1s
 => => transferring dockerfile: 32B                                                 0.1s
 => [internal] load metadata for                    0.6s
 => [internal] load metadata for                    0.7s
 => [builder 1/5] FROM         0.0s
 => => resolve                 0.0s
 => [prod 1/3] FROM                   0.0s
 => => resolve                        0.0s
 => [internal] load build context                                                   0.2s
 => => transferring context: 8.91kB                                                 0.2s
 => CACHED [prod 2/3] WORKDIR /app                                                  0.0s
 => CACHED [builder 2/5] RUN apk --update add --no-cache bash                       0.0s
 => CACHED [builder 3/5] WORKDIR /app                                               0.0s
 => CACHED [builder 4/5] ADD . .                                                    0.0s
 => CACHED [builder 5/5] RUN go build -o app                                        0.0s
 => CACHED [prod 3/3] COPY --from=builder /app/app /app/app                         0.0s
 => exporting to image                                                              1.3s
 => => exporting layers                                                             0.0s
 => => exporting manifest sha256:868d53a5f5...                                      0.0s
 => => exporting config sha256:5fc2c264be...                                        0.0s
 => => pushing layers                                                               1.1s
 => => pushing manifest for                     0.1s
 => exporting cache                                                                 0.1s
 => => preparing build cache for export                                             0.1s

The syntax is very similar to docker build. The main difference is that okteto build automatically pushes the images to the registry if the flag --tag is specified. Check the docs for more details.

How do you like it?

We would ❤️ to hear what you think about builds on remote as a service. You can reach us on Twitter, or in our #okteto channel in the Kubernetes community Slack.

Pablo Chico de GuzmanCTO & Co-founder View all posts

Developing Vue.js and Node.js Apps With Okteto

Kubernetes is a feature-rich tool to solve all kinds of problems of the cloud, but it has a steep learning curve, and applications set up in Kubernetes...

February 01, 2023
Avatar of Mercy BasseyAvatar of Mercy BasseyMercy Bassey

Kubernetes vs. Docker: What’s the Difference

The containerization and container orchestration world has seen a lot of development in recent years. One of the most widely used container technology...

January 06, 2023
Avatar of Anita IhumanAvatar of Anita IhumanAnita Ihuman