-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Improve docker image README - Fix unnecessary/missing newline escapes - Remove double whitespace between parameters - 2-space indent for extra lines in image build commands * Add changelog entry for #8212
- Loading branch information
Showing
2 changed files
with
20 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Docs | ||
body: Fix newline escapes and improve formatting in docker README | ||
time: 2023-07-28T19:34:38.351042747+02:00 | ||
custom: | ||
Author: jamezrin | ||
Issue: "8211" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ This Dockerfile can create images for the following targets, each named after th | |
|
||
In order to build a new image, run the following docker command. | ||
``` | ||
docker build --tag <your_image_name> --target <target_name> <path/to/dockerfile> | ||
docker build --tag <your_image_name> --target <target_name> <path/to/dockerfile> | ||
``` | ||
--- | ||
> **Note:** Docker must be configured to use [BuildKit](https://docs.docker.com/develop/develop-images/build_enhancements/) in order for images to build properly! | ||
|
@@ -54,17 +54,17 @@ docker build --tag <your_image_name> \ | |
To build an image named "my-dbt" that supports redshift using the latest releases: | ||
``` | ||
cd dbt-core/docker | ||
docker build --tag my-dbt --target dbt-redshift . | ||
docker build --tag my-dbt --target dbt-redshift . | ||
``` | ||
|
||
To build an image named "my-other-dbt" that supports bigquery using `dbt-core` version 0.21.latest and the bigquery adapter version 1.0.0b1: | ||
``` | ||
cd dbt-core/docker | ||
docker build \ | ||
--tag my-other-dbt \ | ||
--tag my-other-dbt \ | ||
--target dbt-bigquery \ | ||
--build-arg [email protected] \ | ||
--build-arg [email protected] \ | ||
--build-arg [email protected] \ | ||
. | ||
``` | ||
|
||
|
@@ -87,27 +87,28 @@ There are a few special cases worth noting: | |
docker build --tag my_dbt \ | ||
--target dbt-postgres \ | ||
--build-arg [email protected] \ | ||
<path/to/dockerfile> \ | ||
``` | ||
<path/to/dockerfile> | ||
``` | ||
|
||
* If you need to build against another architecture (linux/arm64 in this example) you can overide the `build_for` build arg: | ||
``` | ||
docker build --tag my_dbt \ | ||
--target dbt-postgres \ | ||
--build-arg build_for=linux/arm64 \ | ||
<path/to/dockerfile> \ | ||
``` | ||
<path/to/dockerfile> | ||
``` | ||
|
||
Supported architectures can be found in the python docker [dockerhub page](https://hub.docker.com/_/python). | ||
|
||
## Running an image in a container: | ||
The `ENTRYPOINT` for this Dockerfile is the command `dbt` so you can bind-mount your project to `/usr/app` and use dbt as normal: | ||
``` | ||
docker run \ | ||
--network=host | ||
--mount type=bind,source=path/to/project,target=/usr/app \ | ||
--mount type=bind,source=path/to/profiles.yml,target=/root/.dbt/profiles.yml \ | ||
my-dbt \ | ||
ls | ||
--network=host \ | ||
--mount type=bind,source=path/to/project,target=/usr/app \ | ||
--mount type=bind,source=path/to/profiles.yml,target=/root/.dbt/profiles.yml \ | ||
my-dbt \ | ||
ls | ||
``` | ||
--- | ||
**Notes:** | ||
|