Merge branch 'pr-414'

* pr-414:
  docker-compose: update formatting
  docker-compose: fix indentation
  Added build from dockerfile using docker-compose
  Added bests pratices and util cmds for dockerfile
This commit is contained in:
Rico Sta. Cruz 2018-03-17 13:30:55 +08:00
commit 059987a752
No known key found for this signature in database
GPG Key ID: CAAD38AE2962619A
2 changed files with 44 additions and 0 deletions

View File

@ -16,6 +16,9 @@ version: '2'
services:
web:
build: .
# build from Dockerfile
context: ./Path
dockerfile: Dockerfile
ports:
- "5000:5000"
volumes:

View File

@ -30,6 +30,16 @@ RUN bundle install
WORKDIR /myapp
```
```
VOLUME ["/data"]
# Specification for mount point
```
```docker
ADD file.xyz /file.xyz
COPY --chown=user:group host_file.xyz /path/container_file.xyz
```
### Onbuild
```bash
@ -44,6 +54,37 @@ EXPOSE 5900
CMD ["bundle", "exec", "rails", "server"]
```
### Entrypoint
```docker
ENTRYPOINT ["executable", "param1", "param2"]
ENTRYPOINT command param1 param2
```
Configures a container that will run as an executable.
```docker
ENTRYPOINT exec top -b
```
This will use shell processing to substitute shell variables, and will ignore any `CMD` or `docker run` command line arguments.
### Metadata
```docker
LABEL version="1.0"
```
```docker
LABEL "com.example.vendor"="ACME Incorporated"
LABEL com.example.label-with-value="foo"
```docker
```docker
LABEL description="This text illustrates \
that label-values can span multiple lines."
```
## See also
{: .-one-column}