Skip to content

Commit 85653d8

Browse files
feat: Listing versions with <command>:?
1 parent 6e210ef commit 85653d8

File tree

4 files changed

+437
-82
lines changed

4 files changed

+437
-82
lines changed

README.md

+21-13
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,27 @@ dockerized npm install # install packages.json
152152

153153
## Switching command versions
154154

155+
**Ad-hoc**
156+
157+
Add `:<version>` to the end of the command to override the version.
158+
159+
```shell
160+
dockerized node:15
161+
```
162+
163+
164+
**Listing versions**
165+
166+
To see which versions are available, run:
167+
168+
```shell
169+
dockerized node:?
170+
# or
171+
dockerized node:
172+
```
173+
174+
**Environment Variables**
175+
155176
Each command has a `<COMMAND>_VERSION` environment variable which you can override.
156177

157178
- `python`: `PYTHON_VERSION`
@@ -188,13 +209,6 @@ This allows you to "lock" your tools to specific versions for your project.
188209
- Create a `dockerized.env` file in your project directory.
189210
- All commands executed within this directory will use the settings specified in this file.
190211

191-
**Ad-hoc**
192-
193-
Add `:<version>` to the end of the command to override the version.
194-
195-
```shell
196-
dockerized node:15
197-
```
198212

199213
**Ad-hoc (Unix)**
200214

@@ -213,12 +227,6 @@ dockerized node:15
213227
dockerized node
214228
```
215229

216-
**Ad-hoc (Windows Powershell)**
217-
218-
It's currently not known how to specify the version of a command in a Powershell script through environment variables.
219-
220-
As an alternative, you can create a `dockerized.env` file in the current directory.
221-
222230
## Localhost
223231

224232
Dockerized applications run within an isolated network. To access services running on your machine, you need to use `host.docker.internal` instead of `localhost`.

go.mod

+7-5
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ replace (
1515
require (
1616
github.com/compose-spec/compose-go v1.1.0
1717
github.com/docker/cli v20.10.12+incompatible
18+
github.com/docker/distribution v2.8.1+incompatible
19+
github.com/docker/hub-tool v0.4.4
20+
github.com/fatih/color v1.13.0
21+
github.com/hashicorp/go-version v1.3.0
1822
github.com/joho/godotenv v1.3.0
1923
)
2024

@@ -33,16 +37,14 @@ require (
3337
github.com/davecgh/go-spew v1.1.1 // indirect
3438
github.com/distribution/distribution/v3 v3.0.0-20210316161203-a01c71e2477e // indirect
3539
github.com/docker/buildx v0.7.1 // indirect
36-
github.com/docker/distribution v2.8.1+incompatible // indirect
3740
github.com/docker/docker v20.10.7+incompatible // indirect
3841
github.com/docker/docker-credential-helpers v0.6.4 // indirect
3942
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c // indirect
4043
github.com/docker/go-connections v0.4.0 // indirect
4144
github.com/docker/go-metrics v0.0.1 // indirect
4245
github.com/docker/go-units v0.4.0 // indirect
43-
github.com/fatih/color v1.13.0 // indirect
4446
github.com/felixge/httpsnoop v1.0.2 // indirect
45-
github.com/fvbommel/sortorder v1.0.1 // indirect
47+
github.com/fvbommel/sortorder v1.0.2 // indirect
4648
github.com/go-logr/logr v1.2.2 // indirect
4749
github.com/go-logr/stdr v1.2.2 // indirect
4850
github.com/gofrs/flock v0.8.0 // indirect
@@ -53,12 +55,12 @@ require (
5355
github.com/google/go-cmp v0.5.6 // indirect
5456
github.com/google/gofuzz v1.2.0 // indirect
5557
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
58+
github.com/google/uuid v1.2.0 // indirect
5659
github.com/gorilla/mux v1.8.0 // indirect
5760
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
5861
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
5962
github.com/hashicorp/errwrap v1.1.0 // indirect
6063
github.com/hashicorp/go-multierror v1.1.1 // indirect
61-
github.com/hashicorp/go-version v1.3.0 // indirect
6264
github.com/imdario/mergo v0.3.12 // indirect
6365
github.com/inconshreveable/mousetrap v1.0.0 // indirect
6466
github.com/json-iterator/go v1.1.12 // indirect
@@ -68,7 +70,7 @@ require (
6870
github.com/mattn/go-isatty v0.0.14 // indirect
6971
github.com/mattn/go-shellwords v1.0.12 // indirect
7072
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
71-
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
73+
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
7274
github.com/miekg/pkcs11 v1.0.3 // indirect
7375
github.com/mitchellh/mapstructure v1.4.3 // indirect
7476
github.com/moby/buildkit v0.9.1-0.20211019185819-8778943ac3da // indirect

0 commit comments

Comments
 (0)