https://github.com/into-docker/build-action
Github Action to run any into-docker builder image
https://github.com/into-docker/build-action
builder-image docker github-actions into-docker
Last synced: 2 months ago
JSON representation
Github Action to run any into-docker builder image
- Host: GitHub
- URL: https://github.com/into-docker/build-action
- Owner: into-docker
- License: mit
- Created: 2020-05-01T09:38:10.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2023-10-19T09:53:28.000Z (over 2 years ago)
- Last Synced: 2026-03-12T18:14:56.882Z (3 months ago)
- Topics: builder-image, docker, github-actions, into-docker
- Language: Shell
- Size: 26.4 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# into-docker/build-action
[](https://spiceprogram.org)
[](https://github.com/into-docker/build-action/releases/latest)
[](https://github.com/into-docker/build-action/actions?query=workflow%3ACI)
This is a [Github Action][gha] to run Docker builds using the [into-docker][]
CLI tool.
## Usage
**Build**
```yaml
- uses: into-docker/build-action@v4
with:
image: target-image:latest
builder: intodocker/clojure
# optional: push to docker registry
- run: >
echo ${{ secrets.DOCKER_PASSWORD }} | \
docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin && \
docker push target-image:latest
```
**Build + Caching**
```yaml
- uses: actions/cache@v2
with:
path: cache-file.tar
key: ${{ runner.os }}-${{ hashFiles('project.clj') }}
- uses: into-docker/build-action@v4
with:
image: target-image:latest
builder: intodocker/clojure
cache-path: cache-file.tar
# ...
```
**Build + Environment Variables**
Make sure that you're providing a `.buildenv` file as outlined [here][buildenv].
Afterwards, you can use the usual Github Actions `env` clause to supply them.
```yaml
- uses: into-docker/build-action@v4
with:
image: target-image:latest
builder: intodocker/clojure
env:
SECRET_USERNAME: ...
SECRET_TOKEN: ...
```
[buildenv]: https://github.com/into-docker/into-docker#secrets-experimental
**Build + Platform**
You'll need to run the [setup-qemu-action][] first, then you can supply the
desired target platform:
```yaml
- uses: docker/setup-qemu-action@v3
- uses: into-docker/build-action@v4
with:
image: target-image:latest
builder: intodocker/clojure
platform: linux/arm64
```
[setup-qemu-action]: https://github.com/docker/setup-qemu-action
## Inputs
| Name | Required | Description |
| :--------------- | :------: | :-------------------------------------------------------------- |
| `builder` | Yes | The [into-docker][] builder image to use. |
| `image` | Yes | The target image that should be created (`name:tag`) |
| `source-path` | No | Path, relative to the project root, to use as build source |
| `artifacts-path` | No | Path, relative to the project root, to write build artifacts to |
| `cache-path` | No | Path to a cache archive that should be used/created |
| `profile` | No | Build profile (provided by the builder image) to use |
| `platform` | No | The target platform to build for (needs into-docker >= 1.1.4) |
| `version` | No | Specific version of the CLI tool to use |
## Outputs
None.
## Development
We use [prettier][] to ensure consistent formatting of Markdown and YAML files.
Please run `yarn` or `npm install` to register the pre-commit hook.
[gha]: https://help.github.com/en/actions
[into-docker]: https://github.com/into-docker/into-docker
[prettier]: https://prettier.io/
## License
```
MIT License
Copyright (c) 2020-2023 Yannick Scherer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```