Skip to content
This repository has been archived by the owner on Mar 5, 2021. It is now read-only.

PackageDrone as Docker Container #68

Closed
mariotoffia opened this issue Jun 22, 2016 · 6 comments
Closed

PackageDrone as Docker Container #68

mariotoffia opened this issue Jun 22, 2016 · 6 comments
Assignees
Labels

Comments

@mariotoffia
Copy link

I’m currently packaging drone into a Docker Container – However I’ve stumbled into a problem. The only way of creating a “real” user is to use the web interface using the ‘admin’ and generated hash.

Is it possible to setup an environment export channel and import that while building the docker image via a command line?

Is it possible to provision a “default” user with password.

I’ve solved the user part jut {storage path}/users.json – but password seems to be put elsewhere.

Cheers,
Mario

@ctron ctron added the question label Jun 22, 2016
@ctron
Copy link
Contributor

ctron commented Jun 22, 2016

Hi,

the "admin" user token (and user name) can be overridden using a system property. I will look that up.

The password is stored in the "users.json" file as well, just as a hashed and salted password, not in plaintext. The field is called "passwordHash" and "passwordSalt".

I am not sure I fully understood the first question regarding the export channel? Maybe you can tell me what you are trying to do.

In general what you can do is to setup up an instance of Package Drone and then copy over the plain file in the filesystem. It may be that this structure changes over releases, but in one release your would be safe. It is also possible to assign a "deploy" key to a channel and import a full channel (or multiple channels at once) using a HTTP request and a ZIP file.

Also will there be a REST based API in the next version. But I am not sure if all features you need will be present.

@ctron
Copy link
Contributor

ctron commented Jun 22, 2016

I did create wiki page about system properties [1].

You could use the system properties for setting the admin token, the name and the roles. So you would have exactly one user as you like it.

[1] https://wiki.eclipse.org/PackageDrone/Configuration/SystemProperties

@ctron ctron self-assigned this Jun 22, 2016
@mariotoffia
Copy link
Author

@ctron Thanks for your support! The wiki was perfect for the admin user.
I now do copy the data path - I've set it to /var/packagedrone where I do a 'docker cp :/var/packagedrone - > packagedrone.tar' and added that to the Dockerfile 'ADD' command.

Everything works perfect! I now can setup "default" channels signing keys for dev and have prod have it's NFS mounted volume for the data.

Thanks for all support!
Mario :)

@mariotoffia
Copy link
Author

mariotoffia commented Jun 22, 2016

Here's my (stripped Dockerfile).

Cheers,
Mario

FROM davidcaste/alpine-java-unlimited-jce:jdk8
MAINTAINER Mario Toffia <mario.toffia@dataductus.se>

ENV PACKAGEDRONE_VERSION=0.13.0
ENV DRONE_STORAGE_BASE=/var/packagedrone
ENV PACKAGE_DRONE_ADMIN_TOKEN=<secret pass>

LABEL packagedrone.version=${PACKAGEDRONE_VERSION}

RUN addgroup packagedrone && \
    mkdir -p ${DRONE_STORAGE_BASE} && \
    mkdir -p /opt/packagedrone && \
    adduser -S -D -g "" -G packagedrone -s /sbin/nologin -h /opt/packagedrone packagedrone && \
    chown -R packagedrone:packagedrone /opt/packagedrone

USER packagedrone

RUN apk add unzip curl --update && \
    curl -sSL http://download.eclipse.org/package-drone/drops/release/${PACKAGEDRONE_VERSION}/org.eclipse.packagedrone.server-${PACKAGEDRONE_VERSION}.zip -o /tmp/org.eclipse.packagedrone.server-${PACKAGEDRONE_VERSION}.zip && \
    unzip -o -d /opt/packagedrone /tmp/org.eclipse.packagedrone.server-${PACKAGEDRONE_VERSION}.zip && \
    apk del unzip curl && \
    rm -rf /tmp/* /var/cache/apk/*

ADD packagedrone.tar /var

EXPOSE 8080

VOLUME /var/packagedrone
ENTRYPOINT ["/opt/packagedrone/server"]

@ctron
Copy link
Contributor

ctron commented Jun 23, 2016

I did update your comment in order to format the Dockerfile correctly. I hope that is ok.

So I think this one can be closed.

@ctron ctron closed this as completed Jun 23, 2016
@mariotoffia
Copy link
Author

Yes!

Thanks again for all the support!

Cheers,
Mario :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants