Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override ID in /etc/os-release to work with Docker Machine #197

Closed
kinghuang opened this issue Sep 25, 2020 · 2 comments
Closed

Override ID in /etc/os-release to work with Docker Machine #197

kinghuang opened this issue Sep 25, 2020 · 2 comments

Comments

@kinghuang
Copy link

Current situation

I used to use CoreOS with docker/machine and GitLab Runner for running GitLab CI/CD jobs. Docker Machine's CoreOS provisioner unfortunately only checks if ID=coreos in /etc/os-release, and not ID_LIKE=coreos. As a result, it is unable to launch machines with Flatcar AMIs.

Impact

I am unable to launch Flatcar Linux instances using Docker Machine.

Ideal future situation

The Docker Machine project is no longer accepting feature enhancements. But, I would still like to be able to use it to launch machines with Flatcar Linux.

Implementation options

Is there a way to customize /etc/os-release to say ID=coreos, so that Docker Machine will apply the coreos provisioner?

Additional information

Docker Machine is now in maintenance mode

@pothos
Copy link
Member

pothos commented Sep 25, 2020

Hello,

like other files that are outside of /usr you can create it through an Ignition config (or Container Linux Config YAML transpiled to Ignition JSON).

Something like this:

storage:
  files:
    - path: /etc/os-release
      filesystem: root
      mode: 0644
      contents:
        inline: |
          NAME="Flatcar Container Linux by Kinvolk"
          ID=coreos
          ID_LIKE=coreos
          VERSION=2512.5.0
          VERSION_ID=2512.5.0
          BUILD_ID=2020-09-14-1819
          PRETTY_NAME="Flatcar Container Linux by Kinvolk 2605.5.0 (Oklo)"
          ANSI_COLOR="38;5;75"
          HOME_URL="https://flatcar-linux.org/"
          BUG_REPORT_URL="https://issues.flatcar-linux.org"
          FLATCAR_BOARD="amd64-usr"

gets transpiled via cat FILE | docker run --rm -i quay.io/coreos/ct:latest-dev.

Not sure how to supply the config to Docker Machine as I don't know it well.

In case it's not possible you could also embed the config into the image by placing it in the OEM partition as user.ign (but you need the other OEM partition contents as well).

@kinghuang
Copy link
Author

Thanks! I had it in my mind that I couldn't just write a file because it's symlinked into /usr. Adding that to my Ignition config worked perfectly. Docker Machine is treating the launched instance as CoreOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants