Skip to content

Commit 0e01923

Browse files
committed
fixed image run issues
1 parent 649a878 commit 0e01923

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ RUN pip install --no-cache-dir -r requirements.txt --user
2525
# images for free. The older but stable python 3.11 is not available.
2626
FROM cgr.dev/chainguard/wolfi-base@sha256:e1d402d624011d0f4439bfb0d46a3ddc692465103c7234a326e0194953c3cfe0
2727
# Set the working directory in the container
28-
WORKDIR /middleware
2928
# copy python packages from builder stage
3029
COPY --from=builder /home/nonroot/.local /home/nonroot/.local
3130
# In in one step, so we do not create layers:
@@ -39,11 +38,12 @@ RUN apk add --no-cache \
3938
git=2.49.0-r1 \
4039
jq=1.8.1-r2 \
4140
openssh-client=10.0_p1-r0 && \
42-
mkdir /middleware/output && \
41+
mkdir -p /middleware/output && \
4342
chown nonroot:nonroot /middleware/output
4443
# Set the user to nonroot. It's defined in the Wolfi base image with the user id 65532
4544
# Copy the application from host
4645
COPY middleware/ /middleware/
46+
COPY config.yml /middleware/config.yml
4747
# We also copy the container-structure-test environment. This make it a lot easier to test the resulting container.
4848
COPY test/container-structure-test /middleware/test/container-structure-test
4949
COPY entrypoint.sh /entrypoint.sh
@@ -52,6 +52,6 @@ RUN chmod +x /entrypoint.sh
5252
USER nonroot
5353
ENTRYPOINT ["/entrypoint.sh"]
5454
# Set the command to run when the container starts
55-
CMD [ "python", "main.py", "-c", "config.yml" ]
55+
CMD ["python", "-m", "middleware.main", "-c", "/middleware/config.yml"]
5656

5757

config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ http_client:
4040
git:
4141
repo_url: git@github.com:fairagro/middleware_repo.git
4242
branch: main
43-
local_path: output
43+
local_path: /middleware/output
4444
user_name: "FAIRagro middleware"
4545
user_email: "middleware@fairagro.net"
4646

middleware/git_repo/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class GitRepo:
7272

7373
def __init__(self, config: GitRepoConfig) -> None:
7474
self._config = config
75-
self._ssh_tempdir = tempfile.TemporaryDirectory(dir='/tmp/ssh') # pylint: disable=R1732
75+
self._ssh_tempdir = tempfile.TemporaryDirectory() # pylint: disable=R1732
7676
self._ssh_key = os.path.abspath(
7777
os.path.join(self._ssh_tempdir.name, "ssh_key"))
7878
self._ssh_authorized_keys = os.path.abspath(

0 commit comments

Comments
 (0)