guusdk / httpfileuploadcomponent

A XMPP External Component that implements XEP-0363 'HTTP File Upload'.
Apache License 2.0
8 stars 10 forks source link

Added Dockerfile #3

Closed Fank closed 7 years ago

Fank commented 7 years ago

Split for #1

Build the image locally: docker build -t httpfileuploadcomponent . Run in docker engine (test): docker run -it --rm httpfileuploadcomponent [Add parameter after it] Run in docker swarm mode: docker service create --name httpfileuploadcomponent --network <XMPP NETWORK> httpfileuploadcomponent

Fank commented 7 years ago

Here my example for:

Its working: https://share.arschgaul.com/0d951c39-22fa-4fa3-bcd8-0d23cafa3775/CmioAYKKRl6ATGUxfAOoqw.jpg

guusdk commented 7 years ago

Hey, thanks for contributing this! This would make an excellent feature.

I'm afraid that I'm running into issues building the docker image. Are you using a newish feature, perhaps? My installation isn't that old, so if it's not working for me, it's likely not working for a lot of people. Is there anything that you can change to have better backwards compatibility?

 ---> e2f6fe2dacef
Step 5 : COPY --from=0 /target/httpfileuploadcomponent-*-SNAPSHOT-jar-with-dependencies.jar /opt/httpfileuploadcomponent.jar
Unknown flag: from
guus@guus-laptop:~/github/httpfileuploadcomponent$ docker -v
Docker version 1.12.6, build 78d1802
Fank commented 7 years ago

Ah i see update your docker version, we are at 17.09! Linux: https://get.docker.com/ Mac: https://docs.docker.com/docker-for-mac/install/

guusdk commented 7 years ago

1.12.6 was released this year

Can you make a change to keep things somewhat backwards compatible? The Dockerfile for this project surely need not use only the very latest features from Docker?

Fank commented 7 years ago

I know, but docker is growing and added a lot of features in there last releases like "--from" which was introduced in docker 17.05. I also cover latest stable https://docs.docker.com/engine/installation/#time-based-release-schedule and docker it self recommend using latest stable.

I could remove --from but it will increase image since a lot, because: A --from command will copy only given files into an other image, this file e.g. I use the jdk environment to build the file and copy them into a light weight jre environment.

And these are the base image it self, if using jdk only, there will also be the dependencies on top.

guusdk commented 7 years ago

Ok you won me over.