Comments (13)
got this error too
arion \
--file docker/db_tests_dev.nix \
--pkgs nix/pkgs.nix \
--project-name "myproj_db_tests_dev" \
run --rm migrator sh -c '\
asdfasdfasdfadsf'
returns
Invalid option `--project-name'
and
arion \
--file docker/db_tests_dev.nix \
--pkgs nix/pkgs.nix \
-p "myproj_db_tests_dev" \
run --rm migrator sh -c '\
asdfasdfasfd'
returns
Invalid option `-p'
Did you mean one of these?
-f
up
top
rm
ps
-h
Usage: arion [-f|--file FILE] [-p|--pkgs EXPR] [--show-trace] [--nix-arg ARG]
(COMMAND | DOCKER-COMPOSE-COMMAND)
had to rollback to cc9e70a
from arion.
yes, I need it as command line option (I think)
from arion.
The issue is that not all compose arguments are duplicated in form of env variables
Options:
-f, --file FILE Specify an alternate compose file
(default: docker-compose.yml)
-p, --project-name NAME Specify an alternate project name
(default: directory name)
--verbose Show more output
--log-level LEVEL Set log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
--no-ansi Do not print ANSI control characters
-v, --version Print version and exit
-H, --host HOST Daemon socket to connect to
--tls Use TLS; implied by --tlsverify
--tlscacert CA_PATH Trust certs signed only by this CA
--tlscert CLIENT_CERT_PATH Path to TLS certificate file
--tlskey TLS_KEY_PATH Path to TLS key file
--tlsverify Use TLS and verify the remote
--skip-hostname-check Don't check the daemon's hostname against the
name specified in the client certificate
--project-directory PATH Specify an alternate working directory
(default: the path of the Compose file)
--compatibility If set, Compose will attempt to convert deploy
keys in v3 files to their non-Swarm equivalent
COMPOSE_API_VERSION
COMPOSE_CONVERT_WINDOWS_PATHS
COMPOSE_FILE
COMPOSE_HTTP_TIMEOUT
COMPOSE_TLS_VERSION
COMPOSE_PROJECT_NAME
DOCKER_CERT_PATH
DOCKER_HOST
DOCKER_TLS_VERIFY
For example --compatibility
One possible way to resolve this would be to add compose
prefix to all arguments
Like --compose-p, --compose-project, --compose-compatibility
from arion.
Hi @srghma,
The option parsing was reworked in the latest merge. I wasn't aware that the project name feature was already usable.
My intent for this feature was to make it configurable in arion-compose.nix
.
To support your use case we'll have to add a command line option to define values in the composition config.
from arion.
Let me share my thoughts :)
Yes, this functionality should be available. However, the proposed implementation conflicts with my goal to simplify the interface compared to docker-compose.
Design goal
Like any piece of software, docker-compose comes with some baggage. I'd like to avoid copying all of that, especially where we have better alternatives due to Nix.
One of the problems with docker-compose is having to deal with a multitude of separate configuration states, specifically:
- the docker compose files
- any environment files
- the process environment
- command line arguments
These can not be assumed to be interchangeable.
So for someone who is learning arion and does not have much knowledge about docker-compose, I don't think we should require them to learn all of that.
Instead of having configuration spread sparsely across a locations × configurations matrix, I'd like to have all locations map to a single "namespace" of configurations.
So what are the locations we do want to have?
- arion-compose modules
- generic ones, following the typical meaning of "module" in Nix
- concrete ones, usually called configurations, importing other modules
- environment variables are available through Nix if necessary, but also in docker-compose literal strings. The latter will be disabled (escaped) by default. They're confusing. These seem to be unavoidable and can serve a role in secrets deployment. I'd recommend against using these for configuration.
- command line arguments to try things out quickly and for things that are truly transient like
--log-level
, or to inject values easily--option-string name=myproject
All of these should be able to set everything including things that are command-line only, like the project name. The project name should be set in a "concrete" arion compose configuration, as defined above.
Implementation
Now that we know where arion is supposed to go, we can figure out the steps to get there.
To address your concern about the availability of (potentially new?) docker-compose command line options, we have a conflict to resolve with the design as above.
This can be address by dividing the problem into known and unknown options.
The known options will have only arion-compose options. Unknown options will be passed via --docker-compose-arg=--new-thing --docker-compose-arg=arg-for-new-thing
.
Proper command line options can be added for these, which will not have options:
- verbosity
- log level
- ansi
Docker-compose command line options that have arion-compose.nix options will be forbidden or warned about when set via --docker-compose-arg
. They should be set with --option-string name=myproject
for example.
--project-directory
will be forbidden entirely. All path handling must happen through nix.
from arion.
ok, I see
having project-name
in nix file works for me too
from arion.
@roberth hi, what's the status of this issue?
from arion.
Worked around it last week to keep focus, but it's time to implement it. Doesn't seem like a lot of work
from arion.
@srghma what do you think of #104?
from arion.
Thx! That would work
Except I think the name project name
is better than name
And how about other compose options?
I don't need them for now, though
from arion.
I've renamed it to project.name
and added support for --no-ansi
, --compatibility
, --log-level
options.
Most of the other ones are better managed as environment variables for now, because they can be security sensitive and the docker compose file is written to the Nix store which is not intended for confidential info.
Support for other module options and command line options can be added later.
from arion.
tnx a lot!
from arion.
In case it helps future readers, I was looking for a way to specify the project name from the command line.
With docker-compose, that looked like:
docker-compose -p "yourProjectName" up
And with arion, that looks like:
COMPOSE_PROJECT_NAME="yourProjectName" arion up
Re-reading this thread, I see that was already explained above, but it took me a while to work that out.
from arion.
Related Issues (20)
- how to 'Improve performance by skipping container image creation'? HOT 2
- services.<name>.service.build.context doesn't work
- Updating/pulling containers on NixOS module deployment. HOT 3
- Allow array of strings to be passed to `entrypoint` HOT 1
- You're using a version of Nixpkgs that doesn't support the includeStorePaths parameter in d HOT 1
- Declarative configuration of supporting operations (using OCI hooks) HOT 2
- Reduce number of layers in built image HOT 1
- How to specify `stdin_open` HOT 1
- [Feat] healthcheck.test is also allowed to be a string
- Infinite recursion when importing from arionPath in configuration.nix HOT 2
- Disable DHCP in NixOS-based containers
- Question: how to get/change input image ( HOT 1
- `arion up` fails with strange error HOT 3
- fails to update on NixOS 23.11 due to nix-store version HOT 3
- shell completions
- ERROR: runtime error: index out of range [0] with length 0 HOT 6
- Arion tries to start a service before podman is up HOT 2
- nix2container integration HOT 1
- Allow setting log namespaces for systemd services generated by Arion on NixOS
- add nixos flake example HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arion.