# docker 빌드 및 실행

이건 안되고

```docker
# build stage
FROM gradle:7.4.2-focal as build-stage
MAINTAINER programmer.jjy@gmail.com

WORKDIR /app
COPY . ./
RUN gradle :config-server:bootJar -x test

# deploy stage
FROM openjdk:17-ubuntu20 as deploy-stage
MAINTAINER programmer.jjy@gmail.com

WORKDIR /app
COPY --from=build-stage /app/config-server/build/libs ./
COPY docker/run.sh ./

RUN chown 755 *

EXPOSE 9000
CMD ["java", "-jar", "*.jar"]
```

이건 된다

```docker
FROM openjdk:17-ubuntu20
MAINTAINER programmer.jjy@gmail.com

WORKDIR /app
COPY ./config-server/build/libs ./

ENV EXECUTABLE_JAR "*.jar"

RUN chown 755 *

EXPOSE 9000
CMD java -jar ${EXECUTABLE_JAR}
#CMD ["bash", "run.sh"]
```

차이점은

```docker
CMD ["java", "-jar", "*.jar"]

CMD java -jar ${EXECUTABLE_JAR}
```

Why??


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://programmer-jjy.gitbook.io/second-brain/technical/trouble-shooting/docker.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
