question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom docker image as workspace

See original GitHub issue

Summary

Hey everyone,

I just deployed a che environment on my microk8s server and it works great with the sample devfiles. Now I want to use my own repo with a custom devfile.

But everytime I try to start the environment I get the following error message: Container tools has state CrashLoopBackOff.

This only happens with the custom devfile.yaml but not with the default one. The problem is, I need a more recent version of Golang, so I need a different file.

This is the devfile.yaml

schemaVersion: 2.1.0
metadata:
  name: kubernetes-image-version-checker
components:
  - name: tools
    container:
      image: quay.io/devfile/golang:latest
      env:
        - name: GOPATH
          value: /projects:/home/user/go
        - name: GOCACHE
          value: /tmp/.cache
      memoryLimit: 2Gi
      mountSources: true
projects:
  - name: kubernetes-image-version-checker
    git:
      remotes:
        origin: "https://gitlab.imanuel.dev/DerKnerd/kubernetes-image-version-checker.git"

The repo is public so feel free to check it yourself.

Relevant information

No response

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
DerKnerdcommented, Dec 2, 2022

Hey @amisevsk,

first of all, thank you for the long response. I managed to get it work. I forked the eclipse-che/che-devfile-registry and built my own, Golang 1.19 image based of UBI8. Might not be the best solution but it works.

This is the new devfile.yaml:

schemaVersion: 2.1.0
metadata:
  name: kubernetes-image-version-checker
components:
  - name: tools
    container:
      image: quay.imanuel.dev/base-images/che-golang-1.19:ac70c9d
      env:
        - name: GOPATH
          value: /projects:/home/user/go
        - name: GOCACHE
          value: /tmp/.cache
      memoryLimit: 2Gi
      mountSources: true
projects:
  - name: kubernetes-image-version-checker
    git:
      remotes:
        origin: "https://gitlab.imanuel.dev/DerKnerd/kubernetes-image-version-checker.git"

The image itself is public, so if anyone needs Golang 1.19 in Che, feel free to use it 🙂

2reactions
tolushacommented, Dec 2, 2022

@DerKnerd Adding sleep command to the devfile helps:

...
components:
  - container:
      command:
        - sleep
        - infinity
...        
Read more comments on GitHub >

github_iconTop Results From Across the Web

Workspace Image - Gitpod
By default, Gitpod uses a standard Docker Image called Workspace-Full as the foundation ... Caveat: The base image of a custom Dockerfile must...
Read more >
Building Custom Images — Kasm 1.12.0 documentation
The ability to create custom Workspaces is a powerful feature of the Kasm framework ... Below is the baseline Dockerfile used to create...
Read more >
Building a Custom Docker Image - Liferay Help Center
Build your custom Liferay DXP image by running ./gradlew buildDockerImage ... You can now build Liferay DXP Docker images in Liferay Workspace!
Read more >
Create a custom container image for training | Vertex AI
Building and running your Docker container locally. Pushing the container image to Artifact Registry. Note: Vertex AI supports custom training with container ...
Read more >
Building custom docker image - Vocareum - Documentation
Vocareum provides pre-built image for your projects. But you can create customer docker images by adding packages or services to images provided by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found