Closed TABLE272 closed 4 years ago
Hi! Happy to help. Just to check, can you verify that the host volume and its sub-directories are owned by the same user (1002/1004) used in the container? If that's not the problem I have another idea and I'll be pushing out a new build soon to hopefully fix it.
Thanks, yep was actually just off checking that while waiting for a response. The ownership of the volume directory appears correct. 1002/1004 are for the "cloudbox" user as listed below.
ls -lah /opt/amp
total 12K
drwxr-xr-x 3 cloudbox cloudbox 4.0K Dec 30 15:52 .
drwxrwxr-x 26 cloudbox cloudbox 4.0K Dec 30 15:52 ..
drwxr-xr-x 2 cloudbox cloudbox 4.0K Dec 30 15:52 .ampdata
This is the same as on the organizr example I was using earlier.
ls -lah /opt/organizr
total 28K
drwxrwxr-x 7 cloudbox cloudbox 4.0K Dec 28 10:55 .
drwxrwxr-x 26 cloudbox cloudbox 4.0K Dec 30 15:52 ..
drwxr-xr-x 2 cloudbox cloudbox 4.0K Dec 28 10:55 keys
drwxr-xr-x 4 cloudbox cloudbox 4.0K Dec 28 10:55 log
drwxrwxr-x 3 cloudbox cloudbox 4.0K Dec 28 10:55 nginx
drwxr-xr-x 2 cloudbox cloudbox 4.0K Dec 28 10:55 php
drwxrwxr-x 3 cloudbox cloudbox 4.0K Dec 30 17:02 www
Figured it might be that too as most my searching around for solutions was pointing towards that, but that appeared to be more so for permission being denied when writing to the host volume, as opposed to this being the opposite.
Ok good to know. It doesn't seem like you're doing anything wrong so hopefully this new build will work. I had a similar issue in testing and this seemed to solve it. It's being built by docker hub right now. I'll let you know when it's done.
Are you using docker compose? If so and you are comfortable sharing your compose file (hiding the secrets of course) that might help.
Good to know its not just me being silly then, still very much new to docker but getting the hang of it I think.
At present im installing via the docker run
command following the template cloudbox provides on their wiki since it works lets encrypt and everything in at the same time.
This is the command I am using
docker run -d \
--name=amp \
--restart=always \
-e PGID=1004 -e PUID=1002 \
--network=cloudbox \
--network-alias=amp \
-p 8080:8080 \
-p 25565:25565 \
-v /opt/amp:/home/amp/.ampdata \
--label com.github.cloudbox.cloudbox_managed=true \
-e VIRTUAL_PORT=8080 \
-e VIRTUAL_HOST=amp.<domain>.com \
-e LETSENCRYPT_HOST=amp.<domain>.com \
-e LETSENCRYPT_EMAIL=<user>@<domain>.com \
-e LICENCE=<key> \
-e MODULE=ADS \
-e USERNAME=<panelusername> \
-e PASSWORD=<panelpassword> \
-e UID=1002 -e GID=1004 \
mitchtalmadge/amp-dockerized
Cloudbox is totally new to me but it's pretty interesting that they put a Let's Encrypt layer on top of any image, that's neat. Your command looks good to me assuming Cloudbox is working as intended.
The new image is built, you should be able to run something like docker pull mitchtalmadge/amp-dockerized
in order to get the latest image. Try it out after pulling and see if it makes any difference :)
That seems to have fixed it, thanks very much.
AMP started up fine with the correct volume information, ls is showing files in the correct bind directory and I tried a quick recreate of the image and it picked up where it left of with instances in tact.
Thanks very much for the assistance :)
Awesome! :D Very exciting.
One other thing, you may run into re-activation problems which I've been investigating here: #3 It looks like Docker tends to re-assign mac addresses and this causes AMP to assume that you've moved the installation to "new hardware" which requires a re-activation (to prevent people sharing instances for example). My way around this is to add a hard-coded mac address through Docker. Could you try this for me?
02:42:AC
in as the prefix:
--mac-address="02:42:AC:XX:XX:XX"
Then restart the container and see if it all still works. Hopefully after doing this you will never experience a de-activation. If you do, let me know here: #3. I'm still looking into ways of detecting when containers need to be re-activated and doing it manually, but it's taking a bit of time to figure out.
Just a note, the first boot after hard-coding a mac address may cause an initial de-activation; the easiest way to re-activate is just to wipe the volume and start over, but if you have substantial work put into it then it's a bit more involved. You'd have to exec into the container with a bash shell, then run:
su amp --command "ampinstmgr Reactivate Main \"${LICENCE}\""
and again for any other instances you have, replacing Main
with them (for example, Minecraft01
). Don't change the LICENCE part, it is filled in with the environment variable you supplied when starting the container automatically.
Hopefully you don't have to do that but if you ever start getting activation errors let me know and I'll walk you through it.
Thanks, I actually noticed that issue earlier when checking if this issue had been reported already. I've gone ahead and made that mac address change so i'll close this issue down and let you know over on #3 if anything happens regarding deactivation. Keep up the good work :)
Hi, first thanks for making this container. Suits my needs perfectly, just having one issue with it at the moment which im 100% sure is my error but can't figure it out with my lack of experience.
Whenever I have the volume bind setup AMP is failing to start with an access to path is denied error. In this case I have the host volume as
/opt/amp
following what my other containers are using and the path in container as/home/amp/.ampdata
.I attempted changing the host location such as to
/home/<user>/amp
but no amount of changes to the host volume seemed to make a difference. However if I have no volume bind set, or one that does not affect the relevant folder inside the container such as simply/.ampdata
in this case, AMP launches fine.However as I am unable to get the bind working, my changes are lost if I need to make any adjustments to the container itself. As far as user profiles go, I am using UID 1002 and GID 1004 in following my other containers, but have also tried with 1000 on both to see if it made a difference.
It's probably something very easy I'm just missing, very much still learning as I go. If you could point me in the direction of what I'm doing wrong that would be appreciated.