Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/docker: add docker "app" command and install/launch/remove subcom… #5240

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

qiangli
Copy link

@qiangli qiangli commented Jul 6, 2024

- What I did

This change adds support for managing native applications on the host machine.

- How I did it

To maximize reuse of existing code, minor refactoring has been done.
more details in the feature ticket here: #5239

- How to verify it

make -f docker.Makefile clean fmt lint shellcheck build
make -f docker.Makefile test-unit test-e2e

All unit/e2e tests passed including newly added ones.

New e2e/app tests verify install/launch/remove commands

- Description for the changelog

cmd/docker: add docker "app" command and install/launch/remove subcommands


+ build/container/cp options are exported, i.e. renamed and a few setters introduced for changing the values:

	image.BuildOptions
	container.RunOptions
	container.ContainerOptions
	container.CopyOptions

+ runBuild, runRun, runCopy are also renamed to RunBuild, RunRun, and RunCopy accordingly
+ All build flags and a small subset of relevant run flags and cp flags are supported.
+ The following new flags are added:

egress: Set container path to export
destination: Set local host path for app
launch: Start app after installation

in addition, the following existing flags are intercepted and handled by the app command:

iidfile
cidfile
detach

+ New environment variables are introduced for the benefit of app developers:

HOSTOS, HOSTARCH which are assigned the values of runtime.GOOS and runtime.GOARCH from go.

- A picture of a cute animal (not mandatory but encouraged)

@qiangli
Copy link
Author

qiangli commented Jul 9, 2024

For "app" examples, please see here: https://github.com/dahenito

Check out this PR and build for your host arch, e.g.:

docker buildx bake

build and install this PR as "app" into the default $DOCKER_APP_BASE (~/.docker/app/):

build/docker app install --privileged -v /var/run/docker.sock:/var/run/docker.sock https://github.com/dahenito/docker.git

If successful, the new docker cli with app support should be available under $DOCKER_APP_BASE (~/.docker/app/bin/)

Add the new docker cli to your PATH:

export PATH=$DOCKER_APP_BASE/bin:$PATH

Now you should be able to start building and installing other "apps", e.g go (1.22.5)

docker app install https://github.com/dahenito/[email protected]

@qiangli qiangli force-pushed the 5239-app-command branch 3 times, most recently from 91264bf to f7c5eb7 Compare July 11, 2024 03:27
…mands

This change adds support for managing native applications on the host machine.

To maximize reuse of existing code, minor refactoring has been done:

+ build/container/cp options are exported, i.e. renamed and a few setters introduced for changing the values:

	image.BuildOptions
	container.RunOptions
	container.ContainerOptions
	container.CopyOptions

+ runBuild, runRun, runCopy are also renamed to RunBuild, RunRun, and RunCopy accordingly
+ All build flags and a small subset of relevant run flags and cp flags are supported.
+ The following new flags are added:

egress: Set container path to export
destination: Set local host path for app
launch: Start app after installation

in addition, the following existing flags are intercepted and handled by the app command:

iidfile
cidfile
detach

+ New environment variables are introduced for the benefit of app developers:

HOSTOS, HOSTARCH which are assigned the values of runtime.GOOS and runtime.GOARCH from go.

Signed-off-by: Qiang Li <[email protected]>
…on support

Support force install if app has already been installed
Add default args/envs
Support VERSION build arg

Signed-off-by: Qiang Li <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant