Comments (5)
OK, I think adding much of your reply into the readme.md would provide enough background for most people. I am guessing that anyone who finds your repo is looking for a starting point that they can then build on.
As it is a personal example I think the only changes I would suggest are
- document the password you have set
- remove the font change.
Those 2 changes would at least allow someone to build an iso with your example and then log in to it. The font change can become 'interesting' depending on the test environment - with your settings I end up with a 30x20 screen :(
from pxeless.
Thanks for pointing that out - looks like i do have a few issues in the README.
First:
I've corrected the example commands to be:
docker build -t iso-generator . && \
docker run -it --mount type=bind,source="$(pwd)",target=/app iso-generator \
image-create.sh -a -u user-data.example -n jammy
Second:
I added the -n option to my branch to allow you to specifiy an ubuntu code-name (like focal or jammy)
Here's the function that variable is used with:
# get the url and iso infor for the latest release
latest_release(){
BASE_URL="https://releases.ubuntu.com/${CODE_NAME}/"
log "🔎 Checking for latest ${CODE_NAME} release..."
ISO_FILE_NAME=$(curl -sSL "${BASE_URL}" |grep -oP "ubuntu-.*-server-amd64.iso" |head -n 1)
IMAGE_NAME=$(curl -sSL ${BASE_URL} |grep -o 'Ubuntu .* LTS .*)' |head -n 1)
CURRENT_RELEASE=$(echo "${ISO_FILE_NAME}" | cut -f2 -d-)
SHA_SUFFIX="${CURRENT_RELEASE}"
log "✅ Latest release is ${CURRENT_RELEASE}"
}
# get the url and iso info for a daily release
daily_release(){
BASE_URL="https://cdimage.ubuntu.com/ubuntu-server/${CODE_NAME}/daily-live/current"
log "🔎 Checking for daily ${CODE_NAME} release..."
ISO_FILE_NAME=$(curl -sSL "${BASE_URL}" |grep -oP "${CODE_NAME}-live-server-amd64.iso" |head -n 1)
IMAGE_NAME=$(curl -sSL ${BASE_URL} |grep -o 'Ubuntu .* LTS .*)' |head -n 1)
CURRENT_RELEASE=$(echo "${IMAGE_NAME}" | awk '{print $3}')
SHA_SUFFIX="${CURRENT_RELEASE}"
log "✅ Daily release is ${CURRENT_RELEASE}"
}
There is a short description in the help-text as well:
-n, --code-name The Code Name of the Ubuntu release to download (focal, jammy etc...)
And here are some usage examples:
> docker run -it --mount type=bind,source="$(pwd)",target=/app iso-generator image-create.sh -a -u user-data.basic -n jammy
[2022-08-25 16:07:06] 📁 Created temporary working directory /tmp/tmp.ZPRPX2PF6F
[2022-08-25 16:07:06] 📁 Created temporary build directory /tmp/tmp.LefesDV388
[2022-08-25 16:07:06] 👶 Starting up...
[2022-08-25 16:07:06] 🔎 Checking for daily jammy release...
[2022-08-25 16:07:06] ✅ Daily release is 22.04.1
[2022-08-25 16:07:06] ✅ 22.04.1 is greater than 20.10. Not a legacy image.
> docker run -it --mount type=bind,source="$(pwd)",target=/app iso-generator image-create.sh -a -u user-data.basic -n focal
[2022-08-25 16:09:56] 📁 Created temporary working directory /tmp/tmp.gQe132NkQJ
[2022-08-25 16:09:56] 📁 Created temporary build directory /tmp/tmp.5CjZC2VPBw
[2022-08-25 16:09:56] 👶 Starting up...
[2022-08-25 16:09:56] 🔎 Checking for daily focal release...
[2022-08-25 16:09:57] ✅ Daily release is 20.04.5
[2022-08-25 16:09:57] ❗ 20.04.5 is lower than 20.10. Marking image as legacy.
from pxeless.
Thanks for the quick update to the examples. As a side note your example user-data.basic seems to be a very personal example.
from pxeless.
Yeah that's an accurate description, I wanted to add something that contained more variety of modules used than many other cloud init tutorials and ended up using a mildly sanitized version of my own homelab's config.
I'm not really sure how best to approach providing examples for this project since there's so many possibilities. I'm definitely open to feedback and suggestions in that regard.
There is a companion repo to this one that focuses more on using cloud-init to provision QEMU VMs and has some more examples, as well as some private templates I could clean up and provide if that would be helpful.
You can see some of that work here https://github.com/cloudymax/Scrap-Metal/blob/main/virtual-machines/user-data.sh though it is not documented enough for a release at this time.
My other thought was to simply link to a few other projects and blogs like this one from Puget systems that also cover the topic as an attempt to lessen my own responsibility for maintaining documentation.
from pxeless.
Thanks for the feedback, I'll scale back on the provided example cloud-init and update the documentation to point to resources with more advanced examples.
from pxeless.
Related Issues (16)
- switch combinations HOT 2
- Not a bug, just an FYI to anyone using subdirectories HOT 7
- Working examples with Ubuntu 22.04.1 Desktop? HOT 4
- Update dockerhub readme HOT 1
- Versioned docker images HOT 1
- Wrong module in user-data.advanced file HOT 3
- GUIDE: Testing your ISO with QEMU HOT 1
- BUG: extra files not copied to live system during install when using `-x` HOT 4
- [Question] Offline package installation HOT 2
- [Advice] Unable to log-in to newly created image using user-data.basic config? Try this: HOT 4
- [FEATURE] Add a user account with sudo access in container
- Make sudo conditional to user/env HOT 1
- stat /data/image-create.sh: no such file or directory: unknown. HOT 6
- [FEATURE] Customize boot parameters HOT 2
- Release ISOs are not valid more than a day. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pxeless.