Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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=myprofile

cdk 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