Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
6046dc4
Update README.md: Add table of contents, improve formatting, add trou…
killerwolf Oct 30, 2024
f6efa39
Update GitHub Actions workflow to dynamically test formulas
killerwolf Oct 30, 2024
bd439dd
Fix formula path in workflow and update set-output
killerwolf Oct 30, 2024
5c6e3c2
Update workflow to use environment files and specify node version
killerwolf Oct 30, 2024
183b040
Add comments about Node.js and set-output warnings
killerwolf Oct 30, 2024
f6967ca
Add debug steps to workflow
killerwolf Oct 30, 2024
837bb57
move files
killerwolf Oct 30, 2024
837d2ba
Simplify formula name extraction in workflow
killerwolf Oct 30, 2024
38e726b
Add step to print environment variables
killerwolf Oct 30, 2024
722d1e5
Simplify loop and add debug output in get_formulas step
killerwolf Oct 30, 2024
aa2d21b
Use array to build formula list
killerwolf Oct 30, 2024
9a15e1d
Fix formula string concatenation
killerwolf Oct 30, 2024
8444832
fix with o1-mini
killerwolf Oct 30, 2024
c4cc96c
fix with o1-mini
killerwolf Oct 30, 2024
be7defa
try removing node-version
killerwolf Nov 22, 2024
18d0fe1
wip
killerwolf Nov 23, 2024
d0c7f86
wip
killerwolf Nov 23, 2024
85b26a9
wip
killerwolf Nov 23, 2024
cbd7933
wip
killerwolf Nov 23, 2024
78bdd9b
wip
killerwolf Nov 23, 2024
11dc5fe
wip
killerwolf Nov 24, 2024
792a4de
wip
killerwolf Nov 24, 2024
502631e
remove hugo
killerwolf Nov 24, 2024
3dfdaa6
adds docker
killerwolf Nov 24, 2024
b620387
fix
killerwolf Nov 24, 2024
5387f7a
fix
killerwolf Nov 24, 2024
7ebb1b2
wip
killerwolf Nov 24, 2024
4878754
wip
killerwolf Nov 24, 2024
22d1dbd
wip
killerwolf Nov 24, 2024
1489a24
wip
killerwolf Nov 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/test-formulas.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Test Homebrew Formulas

on:
push:
branches:
- feature/update

jobs:
test:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

#- name: Check and install Homebrew
# run: |
# if ! command -v brew &>/dev/null; then
# /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# echo "/home/linuxbrew/.linuxbrew/bin/" >> $PATH
# fi

- name: Install Homebrew
run: echo $PATH && brew update

- name: Install dependencies
run: |
brew install coreutils docker colima
brew services start colima

- name: List Formula directory contents
run: ls -l ./Formula

- name: Get formula names
id: get_formulas
run: |
formula_string=""
while IFS= read -r -d $'\0' formula_file; do
formula_name=$(basename "$formula_file" .rb)
echo "Found formula: $formula_name"
formula_string="$formula_string $formula_name"
done < <(find ./Formula -maxdepth 1 -type f -name '*.rb' -print0)
echo "FORMULAS=$formula_string" >> $GITHUB_ENV
echo "Final formulas: $formula_string"

- name: Test each formula
run: |
echo "Formulas to test: ${FORMULAS}"
for formula in ${FORMULAS}; do
echo "Testing formula: $formula"
brew install dockbrew/tap/$formula || echo "Error installing $formula"
brew audit --strict --new --online dockbrew/tap/$formula
brew test dockbrew/tap/$formula
done
11 changes: 8 additions & 3 deletions ab.rb → Formula/ab.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
class Ab < Formula
desc "install ApacheBench as a docker container"
desc "Install ApacheBench as a docker container"
homepage "https://github.com/jfrazelle/dockerfiles/tree/master/ab"
url "https://github.com/dockbrew/ab/archive/2.3.tar.gz"
version "2.3"
url "https://github.com/dockbrew/ab/archive/refs/tags/2.3.tar.gz"
sha256 "8818e940beb458743bdf3a1fc3c3b373956fc89379eb5025ad0f6b8c2465aad6"

depends_on "docker"

def install
bin.install "ab"
end

test do
system bin/"ab", "-V"
end
end
162 changes: 97 additions & 65 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,86 +1,118 @@
# homebrew-docker
containerized equivalent of your usual tools/app with [homebrew](http://brew.sh) workflow :)

Containerized equivalent of your usual tools/app with [homebrew](http://brew.sh) workflow :)

## Table of Contents

* [Usage](#usage)
* [Get dockbrew](#get-dockbrew)
* [Search all dockbrew formulas](#search-all-dockbrew-formulas)
* [Install dockbrew powered app/tools/package](#install-dockbrew-powered-apptoolspackage)
* [Known caveats &amp; issues](#known-caveats--issues)
* [Troubleshooting](#troubleshooting)
* [Contributing](#contributing)
* [License](#license)


## Usage

### Get dockbrew
$ brew tap dockbrew/tap
==> Tapping dockbrew/tap
Cloning into '/usr/local/Library/Taps/dockbrew/homebrew-tap'...

```bash
brew tap dockbrew/tap
```

### Search all dockbrew formulas
brew search dockbrew
dockbrew/tap/ab dockbrew/tap/docker-composer
dockbrew/tap/docker-ansible dockbrew/tap/docker-hugo

```bash
brew search dockbrew
```

### Install dockbrew powered app/tools/package

Here is an example: Get ApacheBench (ab)

$ brew install dockbrew/tap/ab
==> Installing ab from dockbrew/homebrew-tap
==> Downloading https://github.com/dockbrew/ab/archive/2.3.tar.gz
Already downloaded: /Library/Caches/Homebrew/ab-2.3.tar.gz
🍺 /usr/local/Cellar/ab/2.3: 2 files, 8.0K, built in 2 seconds
```bash
brew install dockbrew/tap/ab
```

And run it as you usually do

$ ab -n10 -c10 http://www.google.fr/
This is ApacheBench, Version 2.3 <$Revision: 1663405 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking www.google.fr (be patient).....done


Server Software: gws
Server Hostname: www.google.fr
Server Port: 80

Document Path: /
Document Length: 153980 bytes

Concurrency Level: 10
Time taken for tests: 2.003 seconds
Complete requests: 10
Failed requests: 9
(Connect: 0, Receive: 0, Length: 9, Exceptions: 0)
Total transferred: 1547790 bytes
HTML transferred: 1539572 bytes
Requests per second: 4.99 [#/sec] (mean)
Time per request: 2003.045 [ms] (mean)
Time per request: 200.305 [ms] (mean, across all concurrent requests)
Transfer rate: 754.61 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 27 30 2.6 31 34
Processing: 922 1454 362.1 1608 1975
Waiting: 70 206 233.0 163 861
Total: 950 1484 363.1 1639 2003

Percentage of the requests served within a certain time (ms)
50% 1639
66% 1696
75% 1790
80% 1889
90% 2003
95% 2003
98% 2003
99% 2003
100% 2003 (longest request)

## Known caveats && issues
Dockbrew is in pre-alpha release state, it leverage docker to unclutter your MacOSX host. You first need to run a docker-host locally on your Mac host (`docker-machine` comes in handy, jusr run `docker-machine create dockbrew -d virtualbox && eval "$(docker-machine env dockbrew)"`)
```bash
ab -n10 -c10 http://www.google.fr/
```

This will output benchmarking results similar to the example below:

```
This is ApacheBench, Version 2.3 <$Revision: 1663405 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking www.google.fr (be patient).....done


Server Software: gws
Server Hostname: www.google.fr
Server Port: 80

Document Path: /
Document Length: 153980 bytes

Concurrency Level: 10
Time taken for tests: 2.003 seconds
Complete requests: 10
Failed requests: 9
(Connect: 0, Receive: 0, Length: 9, Exceptions: 0)
Total transferred: 1547790 bytes
HTML transferred: 1539572 bytes
Requests per second: 4.99 [#/sec] (mean)
Time per request: 2003.045 [ms] (mean)
Time per request: 200.305 [ms] (mean, across all concurrent requests)
Transfer rate: 754.61 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 27 30 2.6 31 34
Processing: 922 1454 362.1 1608 1975
Waiting: 70 206 233.0 163 861
Total: 950 1484 363.1 1639 2003

Percentage of the requests served within a certain time (ms)
50% 1639
66% 1696
75% 1790
80% 1889
90% 2003
95% 2003
98% 2003
99% 2003
100% 2003 (longest request)
```

## Known caveats &amp; issues

Dockbrew is in pre-alpha release state; it leverages Docker to unclutter your MacOSX host. You first need to run a Docker host locally on your Mac host (`docker-machine` comes in handy; just run `docker-machine create dockbrew -d virtualbox && eval "$(docker-machine env dockbrew)"`).

## Troubleshooting

* **Error: `docker-machine` not found:** Ensure Docker Machine is installed and configured correctly. Refer to the Docker documentation for installation and setup instructions.
* **Error: Permission denied:** Check your Docker permissions and ensure the user has the necessary privileges to run Docker commands.
* **Error during installation:** Check your internet connection and try again. If the problem persists, check the [issues](https://github.com/dockbrew/homebrew-tap/issues) page for similar problems or open a new issue.


## Contributing
First, thank you for contributing! We love pull requests from everyone.
Here are a few technical guidelines to follow:

1. Open an [issue](https://github.com/dockbrew/homebrew-tap/issues) to discuss a new feature.
1. Open a Pull Request.
1. Edit/Squash after receiving feedback.
1. Party!
First, thank you for contributing! We love pull requests from everyone. Please follow these steps:

1. Fork the repository.
2. Create a new branch for your feature or bug fix.
3. Make your changes and commit them with clear and concise messages.
4. Push your branch to your forked repository.
5. Open a pull request, clearly describing your changes and their purpose.
6. Address any feedback provided by the maintainers.


## License

[GNU GENERAL PUBLIC LICENSE v2](http://www.gnu.org/licenses/gpl-2.0.fr.html)
17 changes: 0 additions & 17 deletions docker-ansible.rb

This file was deleted.

11 changes: 0 additions & 11 deletions docker-composer.rb

This file was deleted.

11 changes: 0 additions & 11 deletions docker-hugo.rb

This file was deleted.