Giter VIP home page Giter VIP logo

Comments (6)

dannykopping avatar dannykopping commented on August 11, 2024

Issue appears to be referencing the devcontainer-kubernetes/main.tf example template.

from envbuilder.

dannykopping avatar dannykopping commented on August 11, 2024

Passing the image name invalid-image to envbuilder results in the fallback image being used.

image

Build logs:

envbuilder - Build development environments from repositories in a container
#1: ๐Ÿ“ฆ Cloning invalid-url to /workspaces/invalid-url...
Failed to clone repository: clone "invalid-url": exec: "git": executable file not found in $PATH
Falling back to the default image...
#2: Deleting filesystem...
#2: ๐Ÿ—๏ธ Building image...
#2: Retrieving image manifest codercom/enterprise-base:ubuntu
...
$ coder ssh bob
coder@coder-danny-bob-69b8f664ff-fk6c4:/workspaces$ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.4 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.4 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

This satisfied the first clause of the feature:

https://pkg.go.dev/github.com/coder/envbuilder#section-readme

FallbackImage specifies an alternative image to use when neither an image is declared in the devcontainer.json file nor a Dockerfile is present.

I'm now going to test out how it behaves when an invalid devcontainer/Dockerfile works.

from envbuilder.

dannykopping avatar dannykopping commented on August 11, 2024

An invalid devcontainer also falls back just fine:

I used this devcontainer: (note the invalid JSON).

#1: ๐Ÿ“ฆ Cloned repository! [1.178864329s]
Failed to parse devcontainer.json: standardize json: hujson: line 5, column 5: invalid character ']' after object value (expecting ',' or '}')
Falling back to the default image...
#2: Deleting filesystem...
#2: ๐Ÿ—๏ธ Building image...
#2: Retrieving image manifest codercom/enterprise-base:ubuntu
...
$ coder ssh bob
coder@coder-danny-bob-84998f4f99-5z9cb:/workspaces$ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.4 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.4 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

from envbuilder.

dannykopping avatar dannykopping commented on August 11, 2024

An invalid Dockerfile also falls back just fine:

I used this devcontainer: (note the invalid Dockerfile)

#1: ๐Ÿ“ฆ Cloned repository! [851.098596ms]
#2: Deleting filesystem...
#2: ๐Ÿ—๏ธ Building image...
Failed to build: parsing dockerfile: dockerfile parse error on line 1: unknown instruction: INVALID
Falling back to the default image...
#2: Deleting filesystem...
#3: ๐Ÿ—๏ธ Building image...
#2: Retrieving image manifest codercom/enterprise-base:ubuntu
...
$ coder ssh bob
coder@coder-danny-bob-84998f4f99-5z9cb:/workspaces$ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.4 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.4 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

from envbuilder.

dannykopping avatar dannykopping commented on August 11, 2024

Closing, this bug no longer exists.

from envbuilder.

dannykopping avatar dannykopping commented on August 11, 2024

This was fixed by #30

from envbuilder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.