Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Shipping containers

Shipping containers

How containers will change the way we ship software.

Alex Tercete

March 19, 2019
Tweet

More Decks by Alex Tercete

Other Decks in Programming

Transcript

  1. • Basic concepts • Containers in the wild • How

    could Redgate leverage containers? • What’s next? Table of contents
  2. FROM XXX COPY XXXXXX RUN XXXXXXX RUN XXXXXXX 1251debdf2 2346ad27d7

    568ba9896f 1b7da6b599 1b7da6b599 Dockerfile image container
  3. FROM XXX COPY XXXXXX RUN XXXXXXX RUN XXXXXXX 1251debdf2 2346ad27d7

    568ba9896f 1b7da6b599 1b7da6b599 127a749973 30285e40a4 072756f83c 79b149c433 532e43ed02 1251debdf2 8a05d95840 2346ad27d7 409df063b4 568ba9896f ca548745fe 1b7da6b599 Dockerfile image registry container
  4. $ docker run --rm \ -e "AWS_ACCESS_KEY_ID=$(AWS_ID)" \ -e "AWS_SECRET_ACCESS_KEY=$(AWS_SECRET)"

    \ mesosphere/aws-cli \ ecr list-images AWS CLI command-line arguments defines environment variables
  5. test_migrations.sh #!/bin/bash docker run \ -e POSTGRES_PASSWORD=mypwd -p 5432:5432 -d

    postgres:11 docker run --rm -v $(pwd):/flyway/sql boxfuse/flyway:5 \ -url=jdbc:postgresql://host.docker.internal:5432/postgres \ -user=postgres \ -password=mypwd \ migrate
  6. test_migrations.sh #!/bin/bash docker run \ -e POSTGRES_PASSWORD=mypwd -p 5432:5432 -d

    postgres:11 docker run --rm -v $(pwd):/flyway/sql boxfuse/flyway:5 \ -url=jdbc:postgresql://host.docker.internal:5432/postgres \ -user=postgres \ -password=mypwd \ migrate
  7. test_migrations.diff #!/bin/bash +docker network create mynet + -docker run \

    +docker run --name mydb --network mynet \ -e POSTGRES_PASSWORD=mypwd -d postgres:11 -docker run --rm -v $(pwd):/flyway/sql boxfuse/flyway:5 \ - -url=jdbc:postgresql://host.docker.internal:5432/postgres \ +docker run --rm --network mynet -v $(pwd):/flyway/sql boxfuse/flyway:5 \ + -url=jdbc:postgresql://mydb:5432/postgres \ -user=postgres \ -password=mypwd \ migrate
  8. DLL

  9. • Containerised SQL Compare CLI • Base images for SQL

    Change Automation • Redgate Platform deployment models How could Redgate leverage containers?
  10. $ docker run --rm \ -e "SERIAL_NUMBER=$(RG_SERIAL_NUMBER)" \ redgate/sql-compare:13.6.0 \

    synchronize \ --source WidgetStaging \ --destination WidgetProduction
  11. $ docker run --rm \ -e "SERIAL_NUMBER=$(RG_SERIAL_NUMBER)" \ redgate/sql-compare:13.6.0 \

    synchronize \ --source WidgetStaging \ --destination WidgetProduction image name version tag command-line arguments
  12. FROM mcr.microsoft.com/dotnet/core/sdk:2.2 COPY ./src /app/src WORKDIR /app/src/MySolution.MyProject RUN dotnet restore

    RUN dotnet publish -c Release -o out ENTRYPOINT ["dotnet", "out/MySolution.MyProject.dll"] Dockerfile
  13. FROM mcr.microsoft.com/dotnet/core/sdk:2.2 COPY ./src /app/src WORKDIR /app/src/MySolution.MyProject RUN dotnet restore

    RUN dotnet publish -c Release -o out ENTRYPOINT ["dotnet", "out/MySolution.MyProject.dll"] Dockerfile build-specific
  14. FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build COPY ./src /app/src WORKDIR /app/src/MySolution.MyProject RUN

    dotnet restore RUN dotnet publish -c Release -o out FROM mcr.microsoft.com/dotnet/core/aspnet:2.2 AS runtime WORKDIR /app COPY --from=build /app/src/MySolution.MyProject/out ./ ENTRYPOINT ["dotnet", "MySolution.MyProject.dll"] Dockerfile
  15. FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build COPY ./src /app/src WORKDIR /app/src/MySolution.MyProject RUN

    dotnet restore RUN dotnet publish -c Release -o out FROM mcr.microsoft.com/dotnet/core/aspnet:2.2 AS runtime WORKDIR /app COPY --from=build /app/src/MySolution.MyProject/out ./ ENTRYPOINT ["dotnet", "MySolution.MyProject.dll"] Dockerfile
  16. FROM XXX COPY XXXXXX RUN XXXXXXX RUN XXXXXXX FROM XXX

    COPY --from ENTRYPOINT 53c59901c1 afa0e18698 ade8f7e850 a36426ba37 97c11f30b3 Dockerfile container 39603b1de3 d54c37ce8b 97c11f30b3 image (stage 1) image (stage 0)
  17. FROM redgate/sql-change-automation:1.0-sdk AS build COPY ./MyProject.Database /project WORKDIR /project RUN

    sca publish ./MyProject.Database.sqlproj --output ./artifacts FROM redgate/sql-change-automation:1.0-mssql AS db COPY --from=build /project/artifacts /sca/artifacts Dockerfile
  18. FROM redgate/sql-change-automation:1.0-sdk AS build COPY ./MyProject.Database /project WORKDIR /project RUN

    sca publish ./MyProject.Database.sqlproj --output ./artifacts FROM redgate/sql-change-automation:1.0-mssql AS db COPY --from=build /project/artifacts /sca/artifacts Dockerfile 1.0-oracle 1.0-postgres 1.0-mysql