-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): Allow passing Docker build secrets (#23778)
Partially closes #14910 and #14395 ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Construct Runtime Dependencies: * [ ] This PR adds new construct runtime dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-construct-runtime-dependencies) ### New Features * [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [x] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information
1 parent
be97e4e
commit 74512fa
Showing
32 changed files
with
349 additions
and
44 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
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
6 changes: 6 additions & 0 deletions
6
packages/@aws-cdk/aws-ecr-assets/test/demo-image-secret/Dockerfile
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 @@ | ||
FROM public.ecr.aws/lambda/python:3.6 | ||
RUN --mount=type=secret,id=mysecret cat /run/secrets/mysecret | ||
EXPOSE 8000 | ||
WORKDIR /src | ||
ADD . /src | ||
CMD python3 index.py |
33 changes: 33 additions & 0 deletions
33
packages/@aws-cdk/aws-ecr-assets/test/demo-image-secret/index.py
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,33 @@ | ||
#!/usr/bin/python | ||
import sys | ||
import textwrap | ||
import http.server | ||
import socketserver | ||
|
||
PORT = 8000 | ||
|
||
|
||
class Handler(http.server.SimpleHTTPRequestHandler): | ||
def do_GET(self): | ||
self.send_response(200) | ||
self.send_header('Content-Type', 'text/html') | ||
self.end_headers() | ||
self.wfile.write(textwrap.dedent('''\ | ||
<!doctype html> | ||
<html><head><title>It works</title></head> | ||
<body> | ||
<h1>Hello from the integ test container</h1> | ||
<p>This container got built and started as part of the integ test.</p> | ||
<img src="https://media.giphy.com/media/nFjDu1LjEADh6/giphy.gif"> | ||
</body> | ||
''').encode('utf-8')) | ||
|
||
|
||
def main(): | ||
httpd = http.server.HTTPServer(("", PORT), Handler) | ||
print("serving at port", PORT) | ||
httpd.serve_forever() | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
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
6 changes: 6 additions & 0 deletions
6
...napshot/asset.60dea2e16e94d1977b92fe03fa7085fea446233f1fe499702b69593438baa59f/Dockerfile
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 @@ | ||
FROM public.ecr.aws/lambda/python:3.6 | ||
RUN --mount=type=secret,id=mysecret cat /run/secrets/mysecret | ||
EXPOSE 8000 | ||
WORKDIR /src | ||
ADD . /src | ||
CMD python3 index.py |
33 changes: 33 additions & 0 deletions
33
....snapshot/asset.60dea2e16e94d1977b92fe03fa7085fea446233f1fe499702b69593438baa59f/index.py
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,33 @@ | ||
#!/usr/bin/python | ||
import sys | ||
import textwrap | ||
import http.server | ||
import socketserver | ||
|
||
PORT = 8000 | ||
|
||
|
||
class Handler(http.server.SimpleHTTPRequestHandler): | ||
def do_GET(self): | ||
self.send_response(200) | ||
self.send_header('Content-Type', 'text/html') | ||
self.end_headers() | ||
self.wfile.write(textwrap.dedent('''\ | ||
<!doctype html> | ||
<html><head><title>It works</title></head> | ||
<body> | ||
<h1>Hello from the integ test container</h1> | ||
<p>This container got built and started as part of the integ test.</p> | ||
<img src="https://media.giphy.com/media/nFjDu1LjEADh6/giphy.gif"> | ||
</body> | ||
''').encode('utf-8')) | ||
|
||
|
||
def main(): | ||
httpd = http.server.HTTPServer(("", PORT), Handler) | ||
print("serving at port", PORT) | ||
httpd.serve_forever() | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
2 changes: 1 addition & 1 deletion
2
packages/@aws-cdk/aws-ecr-assets/test/integ.assets-docker.js.snapshot/cdk.out
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 |
---|---|---|
@@ -1 +1 @@ | ||
{"version":"24.0.0"} | ||
{"version":"29.0.0"} |
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
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
2 changes: 1 addition & 1 deletion
2
packages/@aws-cdk/aws-ecr-assets/test/integ.assets-docker.js.snapshot/integ.json
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"version": "24.0.0", | ||
"version": "29.0.0", | ||
"testCases": { | ||
"integ.assets-docker": { | ||
"stacks": [ | ||
|
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
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
Oops, something went wrong.