Skip to content

Commit 385b2b2

Browse files
milldrosterman
andauthored
feat: Dockerfile and Makefile Snippets (#705)
Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>
1 parent e8f169e commit 385b2b2

File tree

5 files changed

+63
-43
lines changed

5 files changed

+63
-43
lines changed

docs/layers/project/toolbox.mdx

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ import Intro from '@site/src/components/Intro';
88
import ActionCard from '@site/src/components/ActionCard';
99
import PrimaryCTA from '@site/src/components/PrimaryCTA';
1010
import DismissibleDialog from '@site/src/components/DismissibleDialog';
11+
import CodeBlock from '@theme/CodeBlock';
12+
import CollapsibleText from '@site/src/components/CollapsibleText';
13+
import PartialDockerfile from '@site/examples/snippets/components/docker/infra-acme/Dockerfile';
14+
import PartialMakefile from '@site/examples/snippets/Makefile';
1115
import Note from '@site/src/components/Note';
1216

1317
<Intro>
@@ -33,18 +37,36 @@ Geodesic is a powerful Linux toolbox container designed to optimize DevOps workf
3337

3438
## Building the Toolbox Image
3539

36-
Build the Geodesic infrastructure container. This is a container that has all the tools for building the app. It's built
37-
from the `Dockerfile` using a `Makefile`.
40+
Build a Geodesic infrastructure container. This container that has all the tools like terraform and atmos for building infrastructure. It's built from the `Dockerfile` and there are some predefined targets defined in the `Makefile` to make this easy. Customize these for your organization. Here are examples of both for reference.
3841

39-
The standard `Makefile` includes a number of commands. In order to build the initial, complete Geodesic image, run the
40-
following:
42+
<CollapsibleText type="medium">
43+
<CodeBlock title="Dockerfile">{PartialDockerfile}</CodeBlock>
44+
</CollapsibleText>
45+
46+
<CollapsibleText type="medium">
47+
<CodeBlock title="Makefile">{PartialMakefile}</CodeBlock>
48+
</CollapsibleText>
49+
50+
The standard `Makefile` includes a number of commands. In order to build the initial, complete Geodesic image, run the following:
4151

4252
```bash
4353
make all
4454
```
4555

4656
On future builds, use `make run` to use the cached image.
4757

58+
:::tip Alias
59+
60+
We install a wrapper script with `make all` to your chosen namespace. For example, simply enter for given namespace to start your Geodesic container once built:
61+
62+
```bash
63+
acme
64+
```
65+
66+
See the `install` step of the `Makefile` for more details.
67+
68+
:::
69+
4870
Build the toolbox image locally before continuing.
4971

5072
Follow the [toolbox image setup steps in the How-to Get Started guide](/layers/project/#building-the-toolbox-image). In short,

docusaurus.config.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,7 @@ async function createConfig() {
7777
disableInDev: false,
7878
}
7979
],
80-
[
81-
'custom-loaders', {}
82-
],
80+
path.resolve(__dirname, 'plugins/custom-loaders'),
8381
metadataPlugin,
8482
[
8583
"posthog-docusaurus",

examples/snippets/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# placeholder until example is created

plugins/custom-loaders/index.js

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,40 @@ const html = require('html-loader');
88
const path = require('path');
99

1010
module.exports = function (context, options) {
11-
return {
12-
name: 'custom-loaders',
13-
configureWebpack(config, isServer) {
14-
return {
15-
/*output: {
16-
filename: 'custom-loaders-webpack.bundle.js',
17-
},*/
18-
19-
module: {
20-
rules: [
21-
// { test: /\.txt$/, use: 'raw-loader' },
22-
// https://webpack.js.org/loaders/html-loader/
23-
{
24-
test: /\.(html|htm)$/i,
25-
loader: "html-loader",
26-
options: {
27-
minimize: {
28-
removeComments: false,
29-
collapseWhitespace: false,
30-
},
11+
return {
12+
name: 'custom-loaders',
13+
configureWebpack(config, isServer) {
14+
return {
15+
module: {
16+
rules: [
17+
// Existing rule for HTML files
18+
{
19+
test: /\.(html|htm)$/i,
20+
loader: 'html-loader',
21+
options: {
22+
minimize: {
23+
removeComments: false,
24+
collapseWhitespace: false,
3125
},
3226
},
33-
{
34-
test: /\.(txt|yml|yaml|tf)$/,
35-
use: 'raw-loader'
36-
}
37-
],
38-
},
27+
},
28+
{
29+
test: /\.(txt|yml|yaml|tf)$/i,
30+
use: 'raw-loader',
31+
},
32+
{
33+
test: /(?:Dockerfile|Makefile)$/i,
34+
use: 'raw-loader',
35+
},
36+
],
37+
},
3938

40-
resolve: {
41-
alias: {
42-
'@examples': path.resolve(__dirname, 'examples'),
43-
}
44-
}
45-
};
46-
},
47-
};
39+
resolve: {
40+
alias: {
41+
'@examples': path.resolve(__dirname, 'examples'),
42+
},
43+
},
44+
};
45+
},
4846
};
47+
};

plugins/dynamicRedirects/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ async function loadRedirects(allContent) {
3535
}
3636
});
3737

38-
console.debug('Loaded redirects:', redirects);
38+
// console.debug('Loaded redirects:', redirects);
3939
return redirects;
4040
}
4141

@@ -60,7 +60,7 @@ function redirectsPlugin(context, options) {
6060
redirects,
6161
});
6262

63-
console.debug('Global data set with redirects.');
63+
// console.debug('Global data set with redirects.');
6464
},
6565
};
6666
}

0 commit comments

Comments
 (0)