getporter / docker-mixin Goto Github PK
View Code? Open in Web Editor NEWA docker mixin for porter
Home Page: https://getporter.org/mixins/docker
License: Apache License 2.0
A docker mixin for porter
Home Page: https://getporter.org/mixins/docker
License: Apache License 2.0
Update the readme for the mixin example to explain how to use the example bundle.
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:
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
Reference: https://docs.docker.com/engine/reference/commandline/network/
Proposed initial syntax (more can be added in future):
docker network create networkName
docker:
description: "Create a network"
network:
name: networkName
docker network rm networkName
docker:
description: "Delete a network"
network:
name: networkName
absent: false
docker network connect networkName containerA containerB
docker:
description: "Add container to a network"
network:
name: networkName
connected:
- containerA
- containerB
docker network disconnect networkName containerA containerB
docker:
description: "Disconnect container from a network"
network:
name: networkName
disconnected:
- containerA
- containerB
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.
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
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:
Reference: https://docs.docker.com/engine/reference/commandline/wait/
Proposed syntax:
docker wait containerA containerB
docker:
description: "Wait a service"
wait:
container:
- containerA
- container B
The wait
command can be useful for synchronization.
Currently, the default docker version used inside this mixin is 19.03
. I think the version could be upgraded to the latest major release available: https://docs.docker.com/engine/release-notes/. Currently, it's 20.10
.
We could add a feature to docker login to support accepting an access token instead of a password or look into two-factor authentication to improve security. Here are some links to learn more about these options and explore them further. For access tokens - https://docs.docker.com/docker-hub/access-tokens/. For two-factor - https://docs.docker.com/docker-hub/2fa/.
Once ready to list, check out https://github.com/deislabs/porter-packages on the details to add an entry, so that this mixin will show up on porter mixins search
!
Work on the schema command to:
Reference: https://docs.docker.com/engine/reference/commandline/volume/
Proposed initial syntax (more can be added in future):
docker volume create volumeName
docker:
description: "Create a volume"
volume:
name: volumeName
docker volume rm volumeName
docker:
description: "Delete a volume"
volume:
name: volumeName
absent: false
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.
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:
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
Add functionality to allow users to specify the version of the CLI they want downloaded.
Change the name and description of the example bundle to better explain what the bundle does.
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.