Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

try to make it work #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 18 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
FROM ubuntu:latest
FROM debian:latest

USER root
WORKDIR /app

WORKDIR /work
RUN chmod 777 /work

RUN apt-get update && \
apt-get -y install \
'wget' \
'file'
RUN apt-get update && apt-get -y install \
'wget' \
'file' \
'gosu'
# verify that gosu works
RUN gosu nobody true

# install Sen2Cor
RUN wget http://step.esa.int/thirdparties/sen2cor/2.8.0/Sen2Cor-02.08.00-Linux64.run && \
chmod +x Sen2Cor-02.08.00-Linux64.run && \
./Sen2Cor-02.08.00-Linux64.run && \
rm Sen2Cor-02.08.00-Linux64.run
RUN wget http://step.esa.int/thirdparties/sen2cor/2.8.0/Sen2Cor-02.08.00-Linux64.run \
&& sh Sen2Cor-02.08.00-Linux64.run \
&& rm Sen2Cor-02.08.00-Linux64.run

COPY entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh

WORKDIR /work

ENTRYPOINT ["/work/Sen2Cor-02.08.00-Linux64/bin/L2A_Process"]
ENTRYPOINT ["/app/entrypoint.sh"]
CMD ["--help"]
16 changes: 16 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

# Add local user
# Either use the LOCAL_USER_ID if passed in at runtime or
# fallback

USER_ID=${LOCAL_USER_ID:-9001}

echo "Starting with UID : $USER_ID"
useradd --shell /bin/bash -u $USER_ID -o -c "" -m user
export HOME=/home/user

#chmod 777 "/app/Sen2Cor-02.08.00-Linux64/L2A_Bashrc"
#chmod 777 "/app/Sen2Cor-02.08.00-Linux64/bin/L2A_Process"

exec gosu user "/app/Sen2Cor-02.08.00-Linux64/bin/L2A_Process" "$@"