GithubHelp home page GithubHelp logo

getporter / docker-mixin Goto Github PK

View Code? Open in Web Editor NEW
6.0 9.0 7.0 6.4 MB

A docker mixin for porter

Home Page: https://getporter.org/mixins/docker

License: Apache License 2.0

Go 100.00%
porter docker mixin

docker-mixin's People

Contributors

carolynvs avatar carolynvs-msft avatar dependabot[bot] avatar gaurimadhok avatar jaudiger avatar mchorfa avatar vdice avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-mixin's Issues

Docker Pull Command

The docker pull command will be part of the docker mixin to make it easier to use docker from inside a bundle.

The yaml for the pull command would be formatted as shown below:

- docker:
       description:
       pull:
            name: 
            tag: 
            digest:

Docker Remove Command

The docker remove command will be part of the docker mixin to make it easier to use docker from inside a bundle.

The yaml for the remove command would be formatted as shown below:

   - docker:
       description:
       remove:
            container:
            force: # defaults to false

Add docker network command

Reference: https://docs.docker.com/engine/reference/commandline/network/

Proposed initial syntax (more can be added in future):

  • Command: docker network create networkName
docker:
  description: "Create a network"
  network:
    name: networkName
  • Command: docker network rm networkName
docker:
  description: "Delete a network"
  network:
    name: networkName
    absent: false
  • Command: docker network connect networkName containerA containerB
docker:
  description: "Add container to a network"
  network:
    name: networkName
    connected:
    - containerA
    - containerB
  • Command: docker network disconnect networkName containerA containerB
docker:
  description: "Disconnect container from a network"
  network:
    name: networkName
    disconnected:
    - containerA
    - containerB
  • Command: docker network disconnect -f networkName containerA containerB
docker:
  description: "Force container disconnect on a network"
  network:
    name: networkName
    disconnected:
    - containerA
    - containerB
    force: true

The network command can be useful to create/delete a network and associated them with containers.

Docker Run Command

The docker run command will be part of the docker mixin to make it easier to use docker from inside a bundle.

The yaml for the run command would be formatted as shown below:

- docker:
       description:
       run:
            image:
            name: 
            detach: # defaults to false
            ports:
                - host: 
                   container:
            env:
                 password:
            privileged: # defaults to false
            rm: # defaults to false

Docker Login Command

The docker login command will be part of the docker mixin to make it easier to use docker from inside a bundle.

The yaml for the login command would be formatted as shown below:

- docker:
       login:
            username:
            password:

Update Schema

Work on the schema command to:

  1. Add to the type of structs such as ports to make the requirements clear.
  2. Figure out what fields are required for each command and have the schema enforce the requirements.

Add docker volume command

Reference: https://docs.docker.com/engine/reference/commandline/volume/

Proposed initial syntax (more can be added in future):

  • Command: docker volume create volumeName
docker:
  description: "Create a volume"
  volume:
    name: volumeName
  • Command: docker volume rm volumeName
docker:
  description: "Delete a volume"
  volume:
    name: volumeName
    absent: false
  • Command: docker volume rm -f volumeName
docker:
  description: "Force deletion of a volume"
  volume:
    name: volumeName
    absent: false
    force: true

The volume command can be useful to create/delete a volume to share data between containers.

Docker Push Command

The docker push command will be part of the docker mixin to make it easier to use docker from inside a bundle.

The yaml for the push command would be formatted as shown below:

- docker:
       description:
       push:
            name: 
            tag: 

Docker Build Command

The docker build command will be part of the docker mixin to make it easier to use docker from inside a bundle.

The yaml for the build command would be formatted as shown below:

- docker:
       description:
       build:
            tag:
            file: OPTIONAL
            path: # defaults to "." OPTIONAL
            flags:
                rm: ""
                target: base

Docker CLI Version

Add functionality to allow users to specify the version of the CLI they want downloaded.

Update example bundle

Change the name and description of the example bundle to better explain what the bundle does.

It's hard to copy files into a volume

I was trying to use a docker compose file that used this line:

services:
  svcA
    volumes:
    - ./config.yaml:/etc/config.yaml

This doesn't work because the docker host doesn't have access the files in the bundle (we are running DooD).

As a workaround, I am doing this inside the bundle to copy files into a volume, and using the existing volume in docker compose.

    echo "Creating otel-jaeger-config volume"
    docker volume create otel-jaeger-config || true
    
    echo "Copying otel config into volume..."
    docker rm otel-jaeger-helper 2&> /dev/null || true
    docker run -v otel-jaeger-config:/config --name otel-jaeger-helper busybox true
    trap "docker rm otel-jaeger-helper" EXIT

    docker cp config.yaml otel-jaeger-helper:/config

I don't think that this is that far out of a use case. It would be nice if we could figure out a way to easily copy files from the bundle into a volume that can be used later in the bundle.

build should not include a FROM statement

The dockerfile lines injected by the mixin should assume that it is being injected into the Dockerfile.tmpl, and not inject lines that the user may have set in their template, such as FROM, ARG, etc. It should only handle installing the tools required by the mixin but not be a standalone dockerfile essentially.

Right now it is overwriting changes made by the user in their template.

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.