Compare commits

..

19 commits

Author SHA1 Message Date
mrkmntal
a1550d02fa Merge branch 'dev'
All checks were successful
Build & Upload tux-dock / build (push) Successful in 15s
2025-11-03 18:25:35 -05:00
mrkmntal
60b7c9ae90 Add commit hash to compressed files
All checks were successful
Build & Upload tux-dock / build (push) Successful in 7s
2025-11-03 18:11:31 -05:00
mrkmntal
4be73d33da .tar build exploration v2
All checks were successful
Build & Upload tux-dock / build (push) Successful in 7s
2025-11-03 17:54:04 -05:00
mrkmntal
c53d4a98fb .tar build exploration
Some checks failed
Build & Upload tux-dock / build (push) Failing after 7s
2025-11-03 17:51:34 -05:00
mrkmntal
6cca377d2f Artifact QOL fixes
All checks were successful
Build & Upload tux-dock / build (push) Successful in 7s
2025-11-03 17:42:48 -05:00
mrkmntal
01546a0498 Back to debian bookworm for compatibility in build workflow
All checks were successful
Build & Upload tux-dock / build (push) Successful in 8s
2025-11-03 17:37:12 -05:00
mrkmntal
7c79efa2a1 Removing the redundant .zip extension
All checks were successful
Build & Upload tux-dock / build (push) Successful in 6s
2025-11-03 17:31:42 -05:00
mrkmntal
f1b0d41a9c Build Workflow Tweak - letting actions upload zip
All checks were successful
Build & Upload tux-dock / build (push) Successful in 7s
2025-11-03 17:28:40 -05:00
mrkmntal
c933bcbaab Build Workflow Tweak - tar instead of zip file artifact
All checks were successful
Build & Upload tux-dock / build (push) Successful in 7s
2025-11-03 17:24:00 -05:00
mrkmntal
d2e513eb37 Build Workflow Tweak
Some checks failed
Build & Upload tux-dock / build (push) Failing after 6s
2025-11-03 17:21:51 -05:00
mrkmntal
d2b25f54ed trixie runner test, attempt 2
All checks were successful
Build & Upload tux-dock / build (push) Successful in 1m13s
2025-11-03 16:55:48 -05:00
mrkmntal
a4ae73dd8b trixie runner test
Some checks are pending
Build & Upload tux-dock / build (push) Waiting to run
2025-11-03 16:44:23 -05:00
mrkmntal
d4dabad314 Build Artifact test - switch to v3
All checks were successful
Build & Upload tux-dock / build (push) Successful in 7s
2025-11-03 16:22:28 -05:00
mrkmntal
f1ce4da927 Build Artifact test
Some checks failed
Build & Upload tux-dock / build (push) Failing after 19s
2025-11-03 16:20:39 -05:00
mrkmntal
a017b13800 Testing build action, removing included build binary file
All checks were successful
Build TuxDock / build (push) Successful in 4s
/ test (push) Successful in 3s
2025-11-03 16:14:16 -05:00
mrkmntal
56b3d8a376 Workflow retry
All checks were successful
/ test (push) Successful in 3s
2025-11-03 16:12:03 -05:00
mrkmntal
1218614e68 Workflow fix attempt
Some checks failed
Build TuxDock / build (push) Failing after 28s
2025-11-03 16:00:16 -05:00
mrkmntal
b695c3f8ef Add CI build for tuxdock
Some checks failed
Build TuxDock / build (push) Failing after 2m51s
2025-11-03 15:52:34 -05:00
mrkmntal
426dd6e196 Add detached exec option to Docker manager 2025-11-02 08:32:31 -05:00
4 changed files with 93 additions and 12 deletions

View file

@ -0,0 +1,45 @@
name: Build & Upload tux-dock
on:
push:
branches:
- main
- dev
jobs:
build:
runs-on: [self-hosted]
env:
BRANCH: ${{ github.ref_name }}
COMMIT: ${{ github.sha }}
steps:
- name: Clone current branch
run: |
git clone --branch "$BRANCH" https://mentalnet.xyz/forgejo/markmental/tuxdock.git .
echo "✅ Checked out branch $BRANCH ($COMMIT)"
- name: Compile tux-dock
run: |
g++ -std=c++17 main.cpp -o tux-dock
chmod +x tux-dock
echo "🎉 tux-dock compiled and marked executable!"
- name: Verify build
run: file tux-dock
- name: Prepare build artifact (tar.gz)
run: |
mkdir -p build/"$BRANCH"
mv tux-dock build/"$BRANCH"/
SHORT_HASH=$(echo "$COMMIT" | cut -c1-7)
TAR_NAME="tux-dock-linux-x86_64-${BRANCH}-${SHORT_HASH}.tar.gz"
tar czf "$TAR_NAME" -C build "$BRANCH"
echo "📦 Created $TAR_NAME"
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: tux-dock-linux-x86_64-${{ env.BRANCH }}-${{ env.COMMIT }}
path: tux-dock-linux-x86_64-${{ env.BRANCH }}-*.tar.gz

View file

@ -14,6 +14,7 @@ It offers a clean, interactive menu for common Docker operations like pulling im
- 🔹 **Script-to-image workflow** — turn a bash setup script into a Dockerfile and build the resulting image in one go. - 🔹 **Script-to-image workflow** — turn a bash setup script into a Dockerfile and build the resulting image in one go.
- 🔹 **Quick MySQL setup** — spin up a MySQL container with version, password, and port configuration in seconds. - 🔹 **Quick MySQL setup** — spin up a MySQL container with version, password, and port configuration in seconds.
- 🔹 **Get container IP address** — cleanly retrieves and displays only the containers assigned IP. - 🔹 **Get container IP address** — cleanly retrieves and displays only the containers assigned IP.
- 🔹 **Run detached commands** — execute background jobs inside a container without attaching an interactive shell.
- 🔹 **Modern C++ design** — built with classes, minimal dependencies, and clear abstractions. - 🔹 **Modern C++ design** — built with classes, minimal dependencies, and clear abstractions.
--- ---
@ -58,10 +59,11 @@ Tux-Dock: Docker Management Menu
8. Stop Container 8. Stop Container
9. Remove Container 9. Remove Container
10. Attach Shell to Running Container 10. Attach Shell to Running Container
11. Spin Up MySQL Container 11. Run Detached Command in Container
12. Get Container IP Address 12. Spin Up MySQL Container
13. Create Dockerfile & Build Image from Bash Script 13. Get Container IP Address
14. Exit 14. Create Dockerfile & Build Image from Bash Script
15. Exit
``` ```
Each action guides you through the required steps. Each action guides you through the required steps.
@ -92,6 +94,7 @@ class DockerManager {
void runContainerInteractive(); void runContainerInteractive();
void listContainers() const; void listContainers() const;
void startInteractive(); void startInteractive();
void execDetachedCommand();
void stopContainer(); void stopContainer();
void showContainerIP(); void showContainerIP();
}; };

View file

@ -6,6 +6,7 @@
#include <array> #include <array>
#include <fstream> #include <fstream>
#include <filesystem> #include <filesystem>
#include <limits>
using namespace std; using namespace std;
@ -21,6 +22,7 @@ public:
void stopContainer(); void stopContainer();
void removeContainer(); void removeContainer();
void execShell(); void execShell();
void execDetachedCommand();
void createDockerfile(); void createDockerfile();
void spinUpMySQL(); void spinUpMySQL();
void showContainerIP(); void showContainerIP();
@ -153,6 +155,35 @@ void DockerManager::execShell() {
if (!id.empty()) runCommand("docker exec -it " + id + " /bin/sh"); if (!id.empty()) runCommand("docker exec -it " + id + " /bin/sh");
} }
void DockerManager::execDetachedCommand() {
string id = selectContainer("Select container to run command in (detached)");
if (id.empty()) return;
// Flush any leftover newline before using getline
cin.ignore(numeric_limits<streamsize>::max(), '\n');
string command;
cout << "Enter command to execute inside the container: ";
getline(cin, command);
if (command.empty()) {
cout << "No command entered. Aborting.\n";
return;
}
string escapedCommand;
escapedCommand.reserve(command.size() * 2);
for (char c : command) {
if (c == '"' || c == '\\')
escapedCommand += '\\';
escapedCommand += c;
}
cout << "Executing command in detached mode...\n";
runCommand("docker exec -d " + id + " /bin/sh -c \"" + escapedCommand + "\"");
cout << "Command dispatched.\n";
}
void DockerManager::spinUpMySQL() { void DockerManager::spinUpMySQL() {
string port, password, version; string port, password, version;
cout << "Enter port mapping (e.g., 3306:3306): "; cout << "Enter port mapping (e.g., 3306:3306): ";
@ -275,10 +306,11 @@ int main() {
<< "8. Stop Container\n" << "8. Stop Container\n"
<< "9. Remove Container\n" << "9. Remove Container\n"
<< "10. Attach Shell to Running Container\n" << "10. Attach Shell to Running Container\n"
<< "11. Spin Up MySQL Container\n" << "11. Run Detached Command in Container\n"
<< "12. Get Container IP Address\n" << "12. Spin Up MySQL Container\n"
<< "13. Create Dockerfile & Build Image from Bash Script\n" << "13. Get Container IP Address\n"
<< "14. Exit\n" << "14. Create Dockerfile & Build Image from Bash Script\n"
<< "15. Exit\n"
<< "----------------------------------\n" << "----------------------------------\n"
<< "Choose an option: "; << "Choose an option: ";
@ -295,10 +327,11 @@ int main() {
case 8: docker.stopContainer(); break; case 8: docker.stopContainer(); break;
case 9: docker.removeContainer(); break; case 9: docker.removeContainer(); break;
case 10: docker.execShell(); break; case 10: docker.execShell(); break;
case 11: docker.spinUpMySQL(); break; case 11: docker.execDetachedCommand(); break;
case 12: docker.showContainerIP(); break; case 12: docker.spinUpMySQL(); break;
case 13: docker.createDockerfile(); break; case 13: docker.showContainerIP(); break;
case 14: case 14: docker.createDockerfile(); break;
case 15:
cout << "Exiting Tux-Dock.\n"; cout << "Exiting Tux-Dock.\n";
return 0; return 0;
default: default:

BIN
tux-dock

Binary file not shown.