Skip to content

Commit 29f38f1

Browse files
committed
Docs for private docker registry
1 parent 5456caf commit 29f38f1

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

docs/docs.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,22 @@ meteor: {
425425
}
426426
```
427427

428+
### Custom Docker Registry
429+
430+
Simply reference the docker image by url in the `meteor.docker.image` setting:
431+
432+
```
433+
meteor: {
434+
...
435+
docker: {
436+
...
437+
image: 'registry.gitlab.com/someregistry/someimage:sometag'
438+
}
439+
}
440+
```
441+
442+
And then add a docker setup hook to login to your private registry on the server. See [Hooks](#hooks) for example of logging into a private docker registry.
443+
428444
### Image Port
429445

430446
You can set `meteor.docker.port` to the port to expose from the container. This does not affect the port the app is accessed on, only the port the app runs on inside the docker container.
@@ -750,6 +766,22 @@ module.exports = {
750766
'post.meteor.restart': {
751767
remoteCommand: 'docker logs --tail 50 app-name'
752768
},
769+
'pre.docker.setup'(api) {
770+
// Login to private Gitlab docker registry
771+
const config = api.getConfig();
772+
const registry = 'registry.gitlab.com';
773+
const u = process.env.REGISTRY_USERNAME;
774+
const p = process.env.REGISTRY_PASSWORD;
775+
if (!u || !p) {
776+
throw new Error(
777+
'You must provide registry login details'
778+
);
779+
}
780+
return api.runSSHCommand(
781+
config.servers.one,
782+
`docker login -u ${u} -p ${p} ${registry}`
783+
);
784+
},
753785
'post.docker.setup'(api) {
754786
// Same api as is given to plugin command handlers
755787
// If this runs asynchronous tasks, it needs to return a promise.

npm-shrinkwrap.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)