GithubHelp home page GithubHelp logo

fargate's Introduction

このリソースの目的

SpringBootアプリをECS Fargateで動かしている場合に、jvmの監視ができないため、ECS ExecをEnableにしたクラスターをセットアップしています。 このリソースはそのうちのアプリケーション部分に該当します。

maven でのコンパイル

mvn install

Dockerfileからイメージのビルド

docker build --platform amd64 -t akiraabe/spring-boot-docker .

または、、、

Buildpacksでのイメージビルド

docker image rm b5508de20891 // 古いイメージ削除 mvn spring-boot:build-image docker image ls docker tag 0400ea9c7d2e akiraabe/spring-boot-docker:latest

コンテナ実行

docker run --platform=linux/amd64 -p 80:80 -it --rm --name my-running-app akiraabe/spring-boot-docker

// buildpacksで作った時 docker run -p 80:80 -it --rm --name my-running-app akiraabe/spring-boot-docker:latest

DockerHubへのアップ

docker login docker push akiraabe/spring-boot-docker

jvm監視

$ jps 1 ./app.js

$ jstat -gcutil -t 1 5000

ECS Exec

https://dev.classmethod.jp/articles/ecs-exec/

service の設定をみるコマンド

aws ecs describe-services --cluster CdkFargateStack-MyCdkClusterCFA0BF3A-PzVTjplTY9xy --services CdkFargateStack-MyCdkServiceE76112C0-Cp5qERsEfalz


ecs execを有効化するコマンド

aws ecs update-service \
    --cluster CdkFargateStack-MyCdkClusterCFA0BF3A-0wzNDoDes57V --service CdkFargateStack-MyCdkServiceE76112C0-nAXjC1wKElPw \
    --enable-execute-command

動いてるタスクの設定をみるコマンド

aws ecs describe-tasks --cluster CdkFargateStack-MyCdkClusterCFA0BF3A-PzVTjplTY9xy --tasks 6c45fa389174407c962bc267c0f03064

ecs exec

aws ecs execute-command \
  --cluster CdkFargateStack-MyCdkClusterCFA0BF3A-VRdCHzOAwmyB \
  --task e94b8616852b40f8aaf34713057ba4b0 \
  --container web \
  --interactive \
  --command "/bin/sh"

初回はセッションマネージャープラグインの導入が必要であった

https://docs.aws.amazon.com/ja_jp/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html#install-plugin-macos

ECS環境を作るCDKの所在(ECS Execの有効化も組み込み済みです)

/Users/akiraabe/Documents/practice/cdk/cdk-fargate Qiitaも書きました。

https://qiita.com/akiraabe/items/a031aa49824bc74ed094

fargate's People

Contributors

akiraabe avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.