Hi,
I have installed various containers via OMV Docker GUI. For learning, I wish to create docker-compose.yml for all installed containers. Is it possible?
Hi,
I have installed various containers via OMV Docker GUI. For learning, I wish to create docker-compose.yml for all installed containers. Is it possible?
https://github.com/Red5d/docker-autocompose
Never tried it. Would be nice if you would share your experiences.
I use autocompose occasionally. Below is the output when it was run against my running plex-linuxserver container.
But I don't think Portainer will accept the default v3 output. Not sure if Portainer will accept v1 output which autocompose can be configured to provide.
version: "3"
services:
plex-linuxserver:
cap_add:
- AUDIT_WRITE
- CHOWN
- DAC_OVERRIDE
- FOWNER
- FSETID
- KILL
- MKNOD
- NET_BIND_SERVICE
- NET_RAW
- SETFCAP
- SETGID
- SETPCAP
- SETUID
- SYS_CHROOT
cap_drop:
- AUDIT_CONTROL
- BLOCK_SUSPEND
- DAC_READ_SEARCH
- IPC_LOCK
- IPC_OWNER
- LEASE
- LINUX_IMMUTABLE
- MAC_ADMIN
- MAC_OVERRIDE
- NET_ADMIN
- NET_BROADCAST
- SYSLOG
- SYS_ADMIN
- SYS_BOOT
- SYS_MODULE
- SYS_NICE
- SYS_PACCT
- SYS_PTRACE
- SYS_RAWIO
- SYS_RESOURCE
- SYS_TIME
- SYS_TTY_CONFIG
- WAKE_ALARM
container_name: plex-linuxserver
entrypoint:
- /init
environment:
- TZ=America/New_York
- VERSION=latest
- PGID=100
- PUID=1001
- PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
- HOME=/root
- LANGUAGE=en_US.UTF-8
- LANG=en_US.UTF-8
- TERM=xterm
- NVIDIA_DRIVER_CAPABILITIES=compute,video,utility
- DEBIAN_FRONTEND=noninteractive
- PLEX_DOWNLOAD=https://downloads.plex.tv/plex-media-server-new
- PLEX_ARCH=amd64
- 'PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/config/Library/Application Support'
- PLEX_MEDIA_SERVER_HOME=/usr/lib/plexmediaserver
- PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6
- PLEX_MEDIA_SERVER_USER=abc
- PLEX_MEDIA_SERVER_INFO_VENDOR=Docker
- 'PLEX_MEDIA_SERVER_INFO_DEVICE=Docker Container (LinuxServer.io)'
expose:
- 1900/udp
- 3005/tcp
- 32400/tcp
- 32410/udp
- 32412/udp
- 32413/udp
- 32414/udp
- 32469/tcp
- 8324/tcp
hostname: omv
image: linuxserver/plex:latest
ipc: shareable
labels:
build_version: 'Linuxserver.io version:- 1.18.4.2171-ac2afe5f8-ls74 Build-date:-
2020-01-16T00:53:03-05:00'
maintainer: thelamer
logging:
driver: json-file
options: {}
networks:
host:
aliases:
restart: unless-stopped
volumes:
- /srv/dev-disk-by-label-d0/plexmediaserver-database:/config
- /srv/dev-disk-by-label-d1/sftp/outgoing/movies:/data/movies
- /srv/dev-disk-by-label-d1/sftp/outgoing/music:/data/music
- /srv/dev-disk-by-label-d1/sftp/outgoing/tv-series:/data/tv-series
- /etc/localtime:/etc/localtime:ro
- /srv/dev-disk-by-label-d0/plexmediaserver-transcode:/transcode
networks:
host:
external: true
Alles anzeigen
Will a v.3 yml file run correctly from the command line?
Would be nice if you would share your experiences
Sure. BTW, nice tool, thanks to pointing to it.
First, it's working.
Second, I think that it will be useful to share the process of installation for n00bs like me.
1. Install git
sudo apt update
sudo apt install git
2. Optional: change to your docker user folder (mine is "docker1")
cd /home/docker1
3. D/L repo (don't create special folder, git will do it for you)
sudo git clone https://github.com/Red5d/docker-autocompose.git
4. Cnange to created repo folder
cd home/docker1/docker-autocompose
5. Run
sudo docker build -t red5d/docker-autocompose . (Don't miss dot at the end)
6. Run
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock red5d/docker-autocompose <container-name-or-id> <additional-names-or-ids>...
6a. To find container IDs, run
docker ps
Output is in Docker v3 format, you should use -v 1 for version 1, have to check did -v 2 works for 2.0
You have your docker-compose.yml for containers you include in command.
EDIT
Will a v.3 yml file run correctly from the command line?
I am not sure, but I think not. But you can use -v 1
EDIT: -v 1 or -v 2 option give me an error
So, the output is ver 3
have to check did -v 2 works for 2.0
Passing -v 2 gets you a version 3 file
Would be nice if you would share your experiences
Sure. BTW, nice tool, thanks to pointing to it.
First, it's working.
Second, I think that it will be useful to share the process of installation for n00bs like me.
1. Install git
sudo apt update
sudo apt install git
2. Optional: change to your docker user folder (mine is "docker1")
cd /home/docker1
3. D/L repo (don't create special folder, git will do it for you)
sudo git clone https://github.com/Red5d/docker-autocompose.git
4. Cnange to created repo folder
cd home/docker1/docker-autocompose
5. Run
sudo docker build -t red5d/docker-autocompose .
6. Run
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock red5d/docker-autocompose <container-name-or-id> <additional-names-or-ids>...
6a. To find container IDs, run
docker ps
7. run
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock red5d/docker-autocompose <container-name-or-id> <additional-names-or-ids>...
Output is in Docker v3 format, you should use -v 1 for version 1, have to check did -v 2 works for 2.0
You have your docker-compose.yml for containers you include in command.
Will a v.3 yml file run correctly from the command line?
I am not sure, but I think not. But you can use -v 1
Passing -v 2 gets you a version 3 file
Well that sucks.
Hi,
This is cool. I’m try to save my containers configs in a docker compose file too.
For step 6, I can run for more than one container at at time, right ?
Thanks for sharing.
For step 6, I can run for more than one container at at time, right ?
Yes, just put SPACE between IDs OR names
Where is the output file?
Where is the output file?
If you don't direct the autocompose output to a file, then the output is on the console.
Ok. I did.
it worked with id not with the names. mine was...
sudo docker run --rm -v /var/run/docker.sock:/var/run/docker.sock red5d/docker-autocompose e37ff95aeb82 1d4e492180da bc4df6728661 dc9e09f3b80f 765dd33b34ba 38222d1446fe
This works for me:
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock red5d/docker-autocompose sonarr
or with any other running container_name
Passing -v 2 gets you a version 3 file
You can only use v1 oder v3.
V2 is not supported in the code.
I also tested this code here to convert v1 files to v2.3 however it failed to do so...
https://github.com/rindek/dcc
Any other ideas?
hi,
so just for me (ok maybe someone else too) what is the problem if the file is v3 and not v2? in portainer can only v2 be loaded?
but i can just run the v3 file in cli and its set up and appear in portainer as well?
thx
but i can just run the v3 file in cli and its set up and appear in portainer as well?
Yes, but you can't edit it in Portainer
ok, but, how often you need the compose files, for me it would be for migrations - so just take your compose files as a "snapshoot" move to the new maschine - run once and here we go.
until know i only have one compose file - thats the nextcloud letsencrypt one wat i extend to onlyoffice and it runes 2 times until know (one time for nextcloud, the second to add onlyoffice) so i think it dosn't realy matter if v2 or v3. correct me if i didn't see anything here
how often you need the compose files
When I created a post, I want to reinstall my OMV 4 server and install OMV 5. I need yml files for backup purposes. At the end, I start from scratch. But anyway, it's nice backup opportunity to have your yml files somewhere, just to reduce typing
I am old copy-paste guy
yeah thats wat i say, for backup / migration. so (for me) it dosen't matter to paste the files in portainer, our just run them from cli
When I created a post, I want to reinstall my OMV 4 server and install OMV 5. I need yml files for backup purposes. At the end, I start from scratch. But anyway, it's nice backup opportunity to have your yml files somewhere, just to reduce typing
I am old copy-paste guy
Although I made mine manually... I've got about 15 docker-compose files for this exact reason.
When I did a reinstall, I had my server back up in no time flat. If you use filesystem labels, and use those labels consistently, you can even use the compose file to deploy across other servers with very little fuss.
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!