All Projects → into-docker → into-docker

into-docker / into-docker

Licence: MIT license
Never write another Dockerfile

Programming Languages

clojure
4091 projects
shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to into-docker

Cookbook
android-ui-testing.github.io/Cookbook/home/
Stars: ✭ 273 (+232.93%)
Mutual labels:  best-practices
s2i-ruby-container
Ruby container images based on Red Hat Software Collections and intended for OpenShift and general usage, that provide a platform for building and running Ruby applications. Users can choose between Red Hat Enterprise Linux, Fedora, and CentOS based images.
Stars: ✭ 55 (-32.93%)
Mutual labels:  s2i
a11y-contracting
Building Accessibility Best Practices into Contracting
Stars: ✭ 43 (-47.56%)
Mutual labels:  best-practices
accessibility-guide
Client friendly accessibility guide
Stars: ✭ 15 (-81.71%)
Mutual labels:  best-practices
common-coding-conventions
A concise and universal guide to clear software design.
Stars: ✭ 306 (+273.17%)
Mutual labels:  best-practices
ASP.NET-Core-Web-API-Best-Practices-Guide
ASP.NET Core Web API Best Practices Guide
Stars: ✭ 62 (-24.39%)
Mutual labels:  best-practices
eslint-config-galex
hopefully the last eslint config you'll ever need - customizable & modern best practices for JS, TS, Node, React, Remix, Next, Jest, testing-library & storybook
Stars: ✭ 166 (+102.44%)
Mutual labels:  best-practices
php-the-right-way
La version française de "PHP: The Right Way" qui est un condensé des meilleures pratiques sur le développement PHP (conventions, liens vers les tutoriels qui font référence, etc)
Stars: ✭ 51 (-37.8%)
Mutual labels:  best-practices
BackportCpp
Library of backported modern C++ types to work with C++11
Stars: ✭ 53 (-35.37%)
Mutual labels:  best-practices
best-practices
Unosquare Labs Best Practices
Stars: ✭ 19 (-76.83%)
Mutual labels:  best-practices
enterprise-angular-seed
Angular CLI based seed application incorporating many best practices typically needed in Enterprise apps.
Stars: ✭ 62 (-24.39%)
Mutual labels:  best-practices
abap-best-practice
A list of common principles of clean ABAP development
Stars: ✭ 69 (-15.85%)
Mutual labels:  best-practices
dx-scanner
CLI tool that allows you to measure quality of a team work and an app based on your source code.
Stars: ✭ 79 (-3.66%)
Mutual labels:  best-practices
frontend-tips
Super tiny, quick tips, tricks and best practices of front-end development
Stars: ✭ 511 (+523.17%)
Mutual labels:  best-practices
android-oss-best-practices
Best practices on creating Android OSS library projects [JA]
Stars: ✭ 32 (-60.98%)
Mutual labels:  best-practices
playwright-lighthouse
🎭: Playwright Lighthouse Audit
Stars: ✭ 120 (+46.34%)
Mutual labels:  best-practices
go-interfaces
This repos has lots of Go interface usage and best practice examples
Stars: ✭ 112 (+36.59%)
Mutual labels:  best-practices
script-best-practices
Best practices for writing bash scripts
Stars: ✭ 15 (-81.71%)
Mutual labels:  best-practices
talk-dev-to-me-twitch
This repo is a collection of code samples and links to previous twitch live stream sessions. If you have any ideas or suggestions for future episodes, feel free to open an issue.
Stars: ✭ 118 (+43.9%)
Mutual labels:  best-practices
gof design patterns
GoF Design Patterns implemented in modern C++.
Stars: ✭ 21 (-74.39%)
Mutual labels:  best-practices

into-docker

Spice Program Release CI Code Coverage

into-docker lets you build and run applications relying on common frameworks or build tools without ever having to write another Dockerfile. It allows you to bundle up your build environments and processes for others to reuse.

This tool is inspired by s2i and shares some concepts, ideas and goals. However, it targets one specific use case, the classic multi-stage build where artifacts are created in a fat build environment before being injected into a leaner runner environment.

Check out the whitepaper for more details!

Demo

asciicast

Goals

  • Minimum-configuration builds: Rather than providing infinite ways to configure your builds, we encourage the use of defaults and rely on convention over configuration when creating builder images.
  • Promote best practices: Instead of creating a multitude of Docker images of varying quality, developers can benefit from the work of the community in a non-copy/paste fashion. This includes image labels and automatic application of ignore rules.
  • Reproducible builds: By packaging your build environment as a Docker image, it can be versioned just like your source code. The same builder image should, given a specific set of inputs, always produce the same output.
  • Small footprint: Images created by this tool will only differ in one layer from the base image, reducing bandwidth usage when pushing and pulling similar images.
  • Compliance: As maintainer of a build platform you can curate a list of official build environments. Not only do platform users no longer have to write their own Dockerfile - they easily benefit from updates and patches to the build environment.
  • Control the execution environment: Everything above also applies to runner images, allowing platform users to benefit from improvements to the execution environment while complying with regulations and best practices.

Installation

Using Homebrew:

brew install into-docker/brew/into-docker

All releases can be found on the Releases page.

Usage

Make sure to have docker engine running on your machine!

Run Build

To build local sources using an into-docker builder image use the build command and supply the desired target image name and tag:

into build -t <name:tag> <builder> [<path>]

Learn how to create your own builder image or check out existing builder images on Github.

Build Profiles

Builder images can supply multiple build profiles to allow for fine-tuning of the build process. This could, for example, allow you to use the same builder image for your React application whether you're relying on npm or yarn.

You can choose a build profile using the -p/--profile command line argument:

into build -t <name:tag> -p <profile> <builder>

Learn how to add build profiles to your builder image.

Caching

Repeated builds of the same codebase can usually be sped up by caching intermediate build results like downloaded dependencies. By default, into runs a fresh build each time but by supplying the --cache command line argument a cache archive (tar+gzip) will be created at the desired path.

into build -t <name:tag> --cache <path> <builder>

Subsequent builds will use the archive (if it exists) to seed the builder container.

Alternatively, you can rely on a Docker volume for caching. This is an experimental feature and most useful for iterating on builds locally. Note that you'll be responsible yourself for cleaning up the volume.

into build -t <name:tag> --incremental <builder>

Learn how to add caching to your builder image.

Build Artifacts

An into-docker build consists of two stages: build and assemble. To access the artifacts created by the build stage you can write them to a path of your choice using the --write-artifacts flag:

into build --write-artifacts <target-path> <builder> [<path>]

If you omit the -t/--tag flag, only the artifacts will be created, no Docker image.

Secrets (experimental)

When using e.g. private artifact registries, passing environment variables to your build tooling is usually the best way to provide credentials. To do this with into-docker, create a file .buildenv in your source directory that contains the names of the variables you want to pass.

When running a build, those values will be imported from your shell's environment and made available to the build script:

echo "SECRET_PASSWORD" > ".buildenv"
export SECRET_PASSWORD=12345
into build ...

You can read about the mechanism (and the rationale) in the WHITEPAPER.

Platforms

If you're targeting multiple platforms or platforms different from your build machine, you can use the --platform CLI options:

into build -t <name:tag> --platform linux/arm64 <builder>

By default, this will only impact the target image - the build itself will be run on your host's platform. You can use the environment variable DOCKER_DEFAULT_PLATFORM to adapt the builder container's platform. Check out the WHITEPAPER for more insights.

Usage on CI

Due to the minimal-configuration approach of into-docker, it can be easily used on the CI environment of your choice. Check out the following pre-packaged build steps:

Use the --ci flag to direct the CLI tool to use CI-specific assumptions when building images. This allows you, for example, to use environment variables to fill image labels.

Check out the into.build.ci namespace if you want to add more environments.

License

MIT License

Copyright (c) 2020-2021 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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].