Skip to content

Commit 90f02be

Browse files
committed
chore(*/docker): prefix docker image names
1 parent c855458 commit 90f02be

File tree

4 files changed

+16
-17
lines changed

4 files changed

+16
-17
lines changed

README.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ docker-compose up -d
2222

2323
This will create (if not already done) and launch a whole development stack, based on [docker-compose.yml](docker-compose.yml), [docker-compose.override.yml](docker-compose.override.yml), [api/Dockerfile](api/Dockerfile) and [front/Dockerfile](front/Dockerfile) - following images:
2424

25-
* `my-docker-fullstack-project_front_development`: for react development (based on nodejs image)
26-
* `my-docker-fullstack-project_api_development`: for golang in development mode (using [fresh](https://github.com/pilu/fresh) to build and restart the go webserver when you change the sources)
25+
* `topheman/my-docker-fullstack-project_front_development`: for react development (based on nodejs image)
26+
* `topheman/my-docker-fullstack-project_api_development`: for golang in development mode (using [fresh](https://github.com/pilu/fresh) to build and restart the go webserver when you change the sources)
2727
* The `services.api.command` entry in [docker-compose.override.yml](docker-compose.override.yml) will override the default `RUN` command and start a dev server (instead of running the binary compiled in the container at build time)
2828

2929
Go to http://localhost:3000/ to access the frontend, you're good to go, the api is accessible at http://localhost:5000/.
@@ -37,7 +37,7 @@ docker-compose -f ./docker-compose.yml up
3737
This will create (if not already done) and launch a whole production stack only based on [`docker-compose.yml`](docker-compose.yml) and [api/Dockerfile](api/Dockerfile) - following images:
3838

3939
* No nodejs image (it should not be shipped to production, the development image will be used to launch a container that will create the build artefacts with create-react-app).
40-
* `my-docker-fullstack-project_api_production`: for the golang server (with the app compiled) - containing only the binary of the golang app (that way the image)
40+
* `topheman/my-docker-fullstack-project_api_production`: for the golang server (with the app compiled) - containing only the binary of the golang app (that way the image)
4141
* An nginx image *TODO*
4242

4343
## Tests
@@ -68,10 +68,9 @@ You can tell the difference of weight:
6868

6969
```
7070
docker images
71-
REPOSITORY TAG IMAGE ID CREATED SIZE
72-
my-docker-fullstack-project_api_production latest 6021ac7d9d2f 43 minutes ago 11.5MB
73-
my-docker-fullstack-project_api_development latest 755a7ed2bf72 44 minutes ago 426MB
74-
my-docker-fullstack-project_front_development latest 2a71910b5e8c About an hour ago 225MB
71+
topheman/my-docker-fullstack-project_api_production latest 01f1b575fae6 About a minute ago 11.5MB
72+
topheman/my-docker-fullstack-project_api_development latest fff1ef3ec29e 8 minutes ago 426MB
73+
topheman/my-docker-fullstack-project_front_development latest 4ed3aea602ef 22 hours ago 225MB
7574
```
7675

7776
### Commands
@@ -82,11 +81,11 @@ my-docker-fullstack-project_front_development latest 2a71910b5e8c
8281

8382
Don't want to use `docker-compose` (everything bellow is already specified in the `docker*.yml` files - only dropping to remember the syntax for the futur) ?
8483

85-
* `docker build ./api -t my-docker-fullstack-project_api_production`: build the `api` and tag it as `my-docker-fullstack-project_api_production` based on [api/Dockerfile](api/Dockerfile)
86-
* `docker run -d -p 5000:5000 my-docker-fullstack-project_api_production`: runs the `my-docker-fullstack-project_api_production` image previously created in daemon mode and exposes the ports
87-
* `docker build ./front -t my-docker-fullstack-project_front_development`: build the `front` and tag it as `my-docker-fullstack-project_front_development` based on [front/Dockerfile](front/Dockerfile)
88-
* `docker run --rm -p 3000:3000 -v $(pwd)/front:/usr/front -v front-deps:/usr/front/node_modules my-docker-fullstack-project_front_development`:
89-
* runs the `my-docker-fullstack-project_front_development` image previously created in attach mode
84+
* `docker build ./api -t topheman/my-docker-fullstack-project_api_production`: build the `api` and tag it as `topheman/my-docker-fullstack-project_api_production` based on [api/Dockerfile](api/Dockerfile)
85+
* `docker run -d -p 5000:5000 topheman/my-docker-fullstack-project_api_production`: runs the `topheman/my-docker-fullstack-project_api_production` image previously created in daemon mode and exposes the ports
86+
* `docker build ./front -t topheman/my-docker-fullstack-project_front_development`: build the `front` and tag it as `topheman/my-docker-fullstack-project_front_development` based on [front/Dockerfile](front/Dockerfile)
87+
* `docker run --rm -p 3000:3000 -v $(pwd)/front:/usr/front -v front-deps:/usr/front/node_modules topheman/my-docker-fullstack-project_front_development`:
88+
* runs the `topheman/my-docker-fullstack-project_front_development` image previously created in attach mode
9089
* exposes the port 3000
9190
* creates (if not exists) and bind the volumes
9291
* the container will be removed once you kill the process (`--rm`)

api/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ FROM golang:alpine as builder
22

33
# Volumes and commands may be overriden in docker-compose*.yml files.
44
# To build the image in production mode without docker-compose, run:
5-
# `docker build ./api -t my-docker-fullstack-project_api_production`
6-
# `docker run -d -p 5000:5000 my-docker-fullstack-project_api_production`
5+
# `docker build ./api -t topheman/my-docker-fullstack-project_api_production`
6+
# `docker run -d -p 5000:5000 topheman/my-docker-fullstack-project_api_production`
77
ENV APP_ENV "development"
88

99
# alpine comes without git. We need it for go get

docker-compose.override.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ version: "3.4"
22

33
services:
44
api:
5-
image: my-docker-fullstack-project_api_development
5+
image: topheman/my-docker-fullstack-project_api_development
66
command: sh -c "echo \"development\" && go get github.com/pilu/fresh && fresh"
77
build:
88
target: builder
99
volumes:
1010
- ./api:/go/src/github.com/topheman/my-docker-fullstack-project/api
1111
front:
12-
image: my-docker-fullstack-project_front_development
12+
image: topheman/my-docker-fullstack-project_front_development
1313
build:
1414
context: ./front
1515
ports:

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: "3.4"
22

33
services:
44
api:
5-
image: my-docker-fullstack-project_api_production
5+
image: topheman/my-docker-fullstack-project_api_production
66
build:
77
target: production
88
context: ./api

0 commit comments

Comments
 (0)