Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gliptak/aws-cdk-python
AWS Cloud Development Kit (AWS CDK) Python Docker Container
https://github.com/gliptak/aws-cdk-python
aws aws-cdk docker
Last synced: 24 days ago
JSON representation
AWS Cloud Development Kit (AWS CDK) Python Docker Container
- Host: GitHub
- URL: https://github.com/gliptak/aws-cdk-python
- Owner: gliptak
- Created: 2021-05-26T21:48:58.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-11-16T02:31:41.000Z (about 2 months ago)
- Last Synced: 2024-11-16T02:32:11.164Z (about 2 months ago)
- Topics: aws, aws-cdk, docker
- Language: Dockerfile
- Homepage:
- Size: 28.3 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# [AWS Cloud Development Kit (AWS CDK)](https://github.com/aws/aws-cdk) Python Docker Container
[![Build Docker image](https://github.com/gliptak/aws-cdk-python/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/gliptak/aws-cdk-python/actions/workflows/ci.yml?branch=master)
![Docker Image Version (latest semver)](https://img.shields.io/docker/v/gliptak/aws-cdk-python?sort=semver)## Docker containers
https://hub.docker.com/r/gliptak/aws-cdk-python
https://github.com/users/gliptak/packages/container/package/aws-cdk-python
## Usage
Run single (`cdk`) command on mounted project
```
docker run -v ~/.aws:/home/cdk/.aws -v $(pwd):/app --rm -it gliptak/aws-cdk-python:latest /bin/sh -c "/usr/local/bin/cdk version"
```Following https://docs.aws.amazon.com/cdk/latest/guide/hello_world.html
```
docker run -v ~/.aws:/home/cdk/.aws -v $(pwd):/app --rm -it gliptak/aws-cdk-python:latest
```Run commands in container
```
cdk init app --language python
source .venv/bin/activate
python -m pip install -r requirements.txt
``````
cdk ls
cdk synth
``````
export AWS_PROFILE=myprofilecdk bootstrap
cdk deploy
cdk diff
cdk destroy
```## Override UID/GID
Tailor example configuration [docker-compose.yml](docker-compose.yml) and [.env](.env). Note the `--build` flag
```
docker-compose up -d --build
docker-compose exec cdk cdk version
docker-compose exec cdk sh
docker-compose down
```## Notes
https://jtreminio.com/blog/running-docker-containers-as-current-host-user/
https://medium.com/redbubble/running-a-docker-container-as-a-non-root-user-7d2e00f8ee15
https://github.com/moby/moby/issues/34129
https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact
https://docs.aws.amazon.com/cdk/latest/guide/tagging.html
https://docs.github.com/en/actions/guides/publishing-docker-images
https://github.com/opencontainers/image-spec/blob/master/annotations.md
https://github.com/marketplace/actions/publish-docker-image