From 18b55bf0ef9a228a0a5c9114f70a3dda309f6dc2 Mon Sep 17 00:00:00 2001 From: etherealjoy Date: Sun, 10 Jun 2018 14:19:21 +0200 Subject: [PATCH 1/4] Add possibility to build and run go service in a container --- .../codegen/languages/GoServerCodegen.java | 1 + .../main/resources/go-server/Dockerfile.mustache | 14 ++++++++++++++ .../src/main/resources/go-server/README.mustache | 11 +++++++++++ 3 files changed, 26 insertions(+) create mode 100644 modules/openapi-generator/src/main/resources/go-server/Dockerfile.mustache diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoServerCodegen.java index f953acd4e2f8..de934184c8f0 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoServerCodegen.java @@ -110,6 +110,7 @@ public void processOpts() { */ supportingFiles.add(new SupportingFile("openapi.mustache", "api", "openapi.yaml")); supportingFiles.add(new SupportingFile("main.mustache", "", "main.go")); + supportingFiles.add(new SupportingFile("Dockerfile.mustache", "", "Dockerfile")); supportingFiles.add(new SupportingFile("routers.mustache", apiPath, "routers.go")); supportingFiles.add(new SupportingFile("logger.mustache", apiPath, "logger.go")); writeOptional(outputFolder, new SupportingFile("README.mustache", apiPath, "README.md")); diff --git a/modules/openapi-generator/src/main/resources/go-server/Dockerfile.mustache b/modules/openapi-generator/src/main/resources/go-server/Dockerfile.mustache new file mode 100644 index 000000000000..114243086fa2 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/go-server/Dockerfile.mustache @@ -0,0 +1,14 @@ +FROM golang:1.10 AS build +WORKDIR /go/src +COPY {{apiPath}} ./{{apiPath}} +COPY main.go . + +ENV CGO_ENABLED=0 +RUN go get -d -v ./... + +RUN go build -a -installsuffix cgo -o {{packageName}} . + +FROM scratch AS runtime +COPY --from=build /go/src/{{packageName}} ./ +EXPOSE 8080/tcp +ENTRYPOINT ["./{{packageName}}"] diff --git a/modules/openapi-generator/src/main/resources/go-server/README.mustache b/modules/openapi-generator/src/main/resources/go-server/README.mustache index 90814cbfb047..f982b6946c46 100644 --- a/modules/openapi-generator/src/main/resources/go-server/README.mustache +++ b/modules/openapi-generator/src/main/resources/go-server/README.mustache @@ -28,3 +28,14 @@ To run the server, follow these simple steps: go run main.go ``` +To run the server in a docker container +``` +docker build --network=host -t petstore . +``` + +Once image is built use +``` +docker run --rm -it petstore +``` + + From 00f05d8e2524f5bbef833219e907fe5a8704f55c Mon Sep 17 00:00:00 2001 From: etherealjoy Date: Sun, 10 Jun 2018 14:25:59 +0200 Subject: [PATCH 2/4] Remove tabs --- .../org/openapitools/codegen/languages/GoServerCodegen.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoServerCodegen.java index de934184c8f0..6e650b9ad56e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoServerCodegen.java @@ -110,7 +110,7 @@ public void processOpts() { */ supportingFiles.add(new SupportingFile("openapi.mustache", "api", "openapi.yaml")); supportingFiles.add(new SupportingFile("main.mustache", "", "main.go")); - supportingFiles.add(new SupportingFile("Dockerfile.mustache", "", "Dockerfile")); + supportingFiles.add(new SupportingFile("Dockerfile.mustache", "", "Dockerfile")); supportingFiles.add(new SupportingFile("routers.mustache", apiPath, "routers.go")); supportingFiles.add(new SupportingFile("logger.mustache", apiPath, "logger.go")); writeOptional(outputFolder, new SupportingFile("README.mustache", apiPath, "README.md")); From d633c270b9572e4f7bcf6f0150f145026c99ab60 Mon Sep 17 00:00:00 2001 From: etherealjoy Date: Sun, 10 Jun 2018 14:29:59 +0200 Subject: [PATCH 3/4] Update Pet Store server sample --- .../go-api-server/.openapi-generator/VERSION | 2 +- .../server/petstore/go-api-server/Dockerfile | 14 + .../petstore/go-api-server/api/openapi.yaml | 576 +++++++++--------- .../petstore/go-api-server/go/README.md | 19 +- 4 files changed, 319 insertions(+), 292 deletions(-) create mode 100644 samples/server/petstore/go-api-server/Dockerfile diff --git a/samples/server/petstore/go-api-server/.openapi-generator/VERSION b/samples/server/petstore/go-api-server/.openapi-generator/VERSION index 096bf47efe31..ad121e8340e0 100644 --- a/samples/server/petstore/go-api-server/.openapi-generator/VERSION +++ b/samples/server/petstore/go-api-server/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +3.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/go-api-server/Dockerfile b/samples/server/petstore/go-api-server/Dockerfile new file mode 100644 index 000000000000..cfdfbaed0804 --- /dev/null +++ b/samples/server/petstore/go-api-server/Dockerfile @@ -0,0 +1,14 @@ +FROM golang:1.10 AS build +WORKDIR /go/src +COPY go ./go +COPY main.go . + +ENV CGO_ENABLED=0 +RUN go get -d -v ./... + +RUN go build -a -installsuffix cgo -o petstoreserver . + +FROM scratch AS runtime +COPY --from=build /go/src/petstoreserver ./ +EXPOSE 8080/tcp +ENTRYPOINT ["./petstoreserver"] diff --git a/samples/server/petstore/go-api-server/api/openapi.yaml b/samples/server/petstore/go-api-server/api/openapi.yaml index 01e572ba924f..c0b60f85ddeb 100644 --- a/samples/server/petstore/go-api-server/api/openapi.yaml +++ b/samples/server/petstore/go-api-server/api/openapi.yaml @@ -1,29 +1,25 @@ openapi: 3.0.1 info: - title: OpenAPI Petstore description: This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. license: name: Apache-2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore version: 1.0.0 servers: - url: http://petstore.swagger.io/v2 tags: -- name: pet - description: Everything about your Pets -- name: store - description: Access to Petstore orders -- name: user - description: Operations about user +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user paths: /pet: - put: - tags: - - pet - summary: Update an existing pet - operationId: updatePet + post: + operationId: addPet requestBody: - description: Pet object that needs to be added to the store content: application/json: schema: @@ -31,28 +27,22 @@ paths: application/xml: schema: $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store required: true responses: - 400: - description: Invalid ID supplied - content: {} - 404: - description: Pet not found - content: {} 405: - description: Validation exception content: {} + description: Invalid input security: - petstore_auth: - write:pets - read:pets - post: + summary: Add a new pet to the store tags: - pet - summary: Add a new pet to the store - operationId: addPet + put: + operationId: updatePet requestBody: - description: Pet object that needs to be added to the store content: application/json: schema: @@ -60,115 +50,148 @@ paths: application/xml: schema: $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store required: true responses: + 400: + content: {} + description: Invalid ID supplied + 404: + content: {} + description: Pet not found 405: - description: Invalid input content: {} + description: Validation exception security: - petstore_auth: - write:pets - read:pets - /pet/findByStatus: - get: + summary: Update an existing pet tags: - pet - summary: Finds Pets by status + /pet/findByStatus: + get: description: Multiple status values can be provided with comma separated strings operationId: findPetsByStatus parameters: - - name: status + - description: Status values that need to be considered for filter + explode: false in: query - description: Status values that need to be considered for filter + name: status required: true - explode: false schema: - type: array items: - type: string default: available enum: - available - pending - sold + type: string + type: array + style: form responses: 200: - description: successful operation content: application/xml: schema: - type: array items: $ref: '#/components/schemas/Pet' + type: array application/json: schema: - type: array items: $ref: '#/components/schemas/Pet' + type: array + description: successful operation 400: - description: Invalid status value content: {} + description: Invalid status value security: - petstore_auth: - write:pets - read:pets - /pet/findByTags: - get: + summary: Finds Pets by status tags: - pet - summary: Finds Pets by tags + /pet/findByTags: + get: + deprecated: true description: Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. operationId: findPetsByTags parameters: - - name: tags + - description: Tags to filter by + explode: false in: query - description: Tags to filter by + name: tags required: true - explode: false schema: - type: array items: type: string + type: array + style: form responses: 200: - description: successful operation content: application/xml: schema: - type: array items: $ref: '#/components/schemas/Pet' + type: array application/json: schema: - type: array items: $ref: '#/components/schemas/Pet' + type: array + description: successful operation 400: - description: Invalid tag value content: {} - deprecated: true + description: Invalid tag value security: - petstore_auth: - write:pets - read:pets + summary: Finds Pets by tags + tags: + - pet /pet/{petId}: - get: + delete: + operationId: deletePet + parameters: + - in: header + name: api_key + schema: + type: string + - description: Pet id to delete + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + 400: + content: {} + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet tags: - pet - summary: Find pet by ID + get: description: Returns a single pet operationId: getPetById parameters: - - name: petId + - description: ID of pet to return in: path - description: ID of pet to return + name: petId required: true schema: - type: integer format: int64 + type: integer responses: 200: - description: successful operation content: application/xml: schema: @@ -176,143 +199,118 @@ paths: application/json: schema: $ref: '#/components/schemas/Pet' + description: successful operation 400: - description: Invalid ID supplied content: {} + description: Invalid ID supplied 404: - description: Pet not found content: {} + description: Pet not found security: - api_key: [] - post: + summary: Find pet by ID tags: - pet - summary: Updates a pet in the store with form data + post: operationId: updatePetWithForm parameters: - - name: petId + - description: ID of pet that needs to be updated in: path - description: ID of pet that needs to be updated + name: petId required: true schema: - type: integer format: int64 + type: integer requestBody: content: application/x-www-form-urlencoded: schema: properties: name: - type: string description: Updated name of the pet - status: type: string + status: description: Updated status of the pet + type: string responses: 405: - description: Invalid input content: {} + description: Invalid input security: - petstore_auth: - write:pets - read:pets - delete: + summary: Updates a pet in the store with form data tags: - pet - summary: Deletes a pet - operationId: deletePet - parameters: - - name: api_key - in: header - schema: - type: string - - name: petId - in: path - description: Pet id to delete - required: true - schema: - type: integer - format: int64 - responses: - 400: - description: Invalid pet value - content: {} - security: - - petstore_auth: - - write:pets - - read:pets /pet/{petId}/uploadImage: post: - tags: - - pet - summary: uploads an image operationId: uploadFile parameters: - - name: petId + - description: ID of pet to update in: path - description: ID of pet to update + name: petId required: true schema: - type: integer format: int64 + type: integer requestBody: content: multipart/form-data: schema: properties: additionalMetadata: - type: string description: Additional data to pass to server - file: type: string + file: description: file to upload format: binary + type: string responses: 200: - description: successful operation content: application/json: schema: $ref: '#/components/schemas/ApiResponse' + description: successful operation security: - petstore_auth: - write:pets - read:pets + summary: uploads an image + tags: + - pet /store/inventory: get: - tags: - - store - summary: Returns pet inventories by status description: Returns a map of status codes to quantities operationId: getInventory responses: 200: - description: successful operation content: application/json: schema: - type: object additionalProperties: - type: integer format: int32 + type: integer + type: object + description: successful operation security: - api_key: [] - /store/order: - post: + summary: Returns pet inventories by status tags: - store - summary: Place an order for a pet + /store/order: + post: operationId: placeOrder requestBody: - description: order placed for purchasing the pet content: '*/*': schema: $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet required: true responses: 200: - description: successful operation content: application/xml: schema: @@ -320,29 +318,49 @@ paths: application/json: schema: $ref: '#/components/schemas/Order' + description: successful operation 400: - description: Invalid Order content: {} + description: Invalid Order + summary: Place an order for a pet + tags: + - store /store/order/{orderId}: - get: + delete: + description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + in: path + name: orderId + required: true + schema: + type: string + responses: + 400: + content: {} + description: Invalid ID supplied + 404: + content: {} + description: Order not found + summary: Delete purchase order by ID tags: - store - summary: Find purchase order by ID + get: description: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions operationId: getOrderById parameters: - - name: orderId + - description: ID of pet that needs to be fetched in: path - description: ID of pet that needs to be fetched + name: orderId required: true schema: + format: int64 maximum: 5 minimum: 1 type: integer - format: int64 responses: 200: - description: successful operation content: application/xml: schema: @@ -350,157 +368,157 @@ paths: application/json: schema: $ref: '#/components/schemas/Order' + description: successful operation 400: - description: Invalid ID supplied content: {} + description: Invalid ID supplied 404: - description: Order not found content: {} - delete: + description: Order not found + summary: Find purchase order by ID tags: - store - summary: Delete purchase order by ID - description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - operationId: deleteOrder - parameters: - - name: orderId - in: path - description: ID of the order that needs to be deleted - required: true - schema: - type: string - responses: - 400: - description: Invalid ID supplied - content: {} - 404: - description: Order not found - content: {} /user: post: - tags: - - user - summary: Create user description: This can only be done by the logged in user. operationId: createUser requestBody: - description: Created user object content: '*/*': schema: $ref: '#/components/schemas/User' + description: Created user object required: true responses: default: - description: successful operation content: {} - /user/createWithArray: - post: + description: successful operation + summary: Create user tags: - user - summary: Creates list of users with given input array + /user/createWithArray: + post: operationId: createUsersWithArrayInput requestBody: - description: List of user object content: '*/*': schema: - type: array items: $ref: '#/components/schemas/User' + type: array + description: List of user object required: true responses: default: - description: successful operation content: {} - /user/createWithList: - post: + description: successful operation + summary: Creates list of users with given input array tags: - user - summary: Creates list of users with given input array + /user/createWithList: + post: operationId: createUsersWithListInput requestBody: - description: List of user object content: '*/*': schema: - type: array items: $ref: '#/components/schemas/User' + type: array + description: List of user object required: true responses: default: - description: successful operation content: {} - /user/login: - get: + description: successful operation + summary: Creates list of users with given input array tags: - user - summary: Logs user into the system + /user/login: + get: operationId: loginUser parameters: - - name: username + - description: The user name for login in: query - description: The user name for login + name: username required: true schema: type: string - - name: password + - description: The password for login in clear text in: query - description: The password for login in clear text + name: password required: true schema: type: string responses: 200: + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string description: successful operation headers: X-Rate-Limit: description: calls per hour allowed by the user schema: - type: integer format: int32 + type: integer X-Expires-After: description: date in UTC when toekn expires schema: - type: string format: date-time - content: - application/xml: - schema: - type: string - application/json: - schema: type: string 400: - description: Invalid username/password supplied content: {} - /user/logout: - get: + description: Invalid username/password supplied + summary: Logs user into the system tags: - user - summary: Logs out current logged in user session + /user/logout: + get: operationId: logoutUser responses: default: - description: successful operation content: {} + description: successful operation + summary: Logs out current logged in user session + tags: + - user /user/{username}: - get: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + in: path + name: username + required: true + schema: + type: string + responses: + 400: + content: {} + description: Invalid username supplied + 404: + content: {} + description: User not found + summary: Delete user tags: - user - summary: Get user by user name + get: operationId: getUserByName parameters: - - name: username + - description: The name that needs to be fetched. Use user1 for testing. in: path - description: The name that needs to be fetched. Use user1 for testing. + name: username required: true schema: type: string responses: 200: - description: successful operation content: application/xml: schema: @@ -508,119 +526,111 @@ paths: application/json: schema: $ref: '#/components/schemas/User' + description: successful operation 400: - description: Invalid username supplied content: {} + description: Invalid username supplied 404: - description: User not found content: {} - put: + description: User not found + summary: Get user by user name tags: - user - summary: Updated user + put: description: This can only be done by the logged in user. operationId: updateUser parameters: - - name: username + - description: name that need to be deleted in: path - description: name that need to be deleted + name: username required: true schema: type: string requestBody: - description: Updated user object content: '*/*': schema: $ref: '#/components/schemas/User' + description: Updated user object required: true responses: 400: - description: Invalid user supplied content: {} + description: Invalid user supplied 404: - description: User not found content: {} - delete: + description: User not found + summary: Updated user tags: - user - summary: Delete user - description: This can only be done by the logged in user. - operationId: deleteUser - parameters: - - name: username - in: path - description: The name that needs to be deleted - required: true - schema: - type: string - responses: - 400: - description: Invalid username supplied - content: {} - 404: - description: User not found - content: {} components: schemas: Order: - title: Pet Order - type: object + description: An order for a pets from the pet store + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2000-01-23T04:56:07.000+00:00 + complete: false + status: placed properties: id: - type: integer format: int64 - petId: type: integer + petId: format: int64 - quantity: type: integer + quantity: format: int32 + type: integer shipDate: - type: string format: date-time - status: type: string + status: description: Order Status enum: - placed - approved - delivered + type: string complete: - type: boolean default: false - description: An order for a pets from the pet store - example: - petId: 6 - quantity: 1 - id: 0 - shipDate: 2000-01-23T04:56:07.000+00:00 - complete: false - status: placed + type: boolean + title: Pet Order + type: object xml: name: Order Category: - title: Pet category - type: object + description: A category for a pet + example: + name: name + id: 6 properties: id: - type: integer format: int64 + type: integer name: type: string - description: A category for a pet - example: - name: name - id: 6 + title: Pet category + type: object xml: name: Category User: - title: a User - type: object + description: A User who is purchasing from the pet store + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username properties: id: - type: integer format: int64 + type: integer username: type: string firstName: @@ -634,116 +644,108 @@ components: phone: type: string userStatus: - type: integer description: User Status format: int32 - description: A User who is purchasing from the pet store - example: - firstName: firstName - lastName: lastName - password: password - userStatus: 6 - phone: phone - id: 0 - email: email - username: username + type: integer + title: a User + type: object xml: name: User Tag: - title: Pet Tag - type: object + description: A tag for a pet + example: + name: name + id: 1 properties: id: - type: integer format: int64 + type: integer name: type: string - description: A tag for a pet - example: - name: name - id: 1 + title: Pet Tag + type: object xml: name: Tag Pet: - title: a Pet - required: - - name - - photoUrls - type: object + description: A pet for sale in the pet store + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available properties: id: - type: integer format: int64 + type: integer category: $ref: '#/components/schemas/Category' name: - type: string example: doggie + type: string photoUrls: + items: + type: string type: array xml: name: photoUrl wrapped: true - items: - type: string tags: + items: + $ref: '#/components/schemas/Tag' type: array xml: name: tag wrapped: true - items: - $ref: '#/components/schemas/Tag' status: - type: string description: pet status in the store enum: - available - pending - sold - description: A pet for sale in the pet store - example: - photoUrls: - - photoUrls - - photoUrls - name: doggie - id: 0 - category: - name: name - id: 6 - tags: - - name: name - id: 1 - - name: name - id: 1 - status: available + type: string + required: + - name + - photoUrls + title: a Pet + type: object xml: name: Pet ApiResponse: - title: An uploaded response - type: object + description: Describes the result of uploading an image resource + example: + code: 0 + type: type + message: message properties: code: - type: integer format: int32 + type: integer type: type: string message: type: string - description: Describes the result of uploading an image resource - example: - code: 0 - type: type - message: message + title: An uploaded response + type: object securitySchemes: petstore_auth: - type: oauth2 flows: implicit: authorizationUrl: http://petstore.swagger.io/api/oauth/dialog scopes: write:pets: modify pets in your account read:pets: read your pets + type: oauth2 api_key: - type: apiKey - name: api_key in: header + name: api_key + type: apiKey diff --git a/samples/server/petstore/go-api-server/go/README.md b/samples/server/petstore/go-api-server/go/README.md index 100f25037893..c141a6deb3f0 100644 --- a/samples/server/petstore/go-api-server/go/README.md +++ b/samples/server/petstore/go-api-server/go/README.md @@ -1,16 +1,16 @@ # Go API Server for petstoreserver -This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. ## Overview -This server was generated by the [swagger-codegen] -(https://github.com/swagger-api/swagger-codegen) project. +This server was generated by the [openapi-generator] +(https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate a server stub. - To see how to make this your own, look here: -[README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md) +[README]((https://openapi-generator.tech)) - API version: 1.0.0 @@ -22,3 +22,14 @@ To run the server, follow these simple steps: go run main.go ``` +To run the server in a docker container +``` +docker build --network=host -t petstore . +``` + +Once image is built use +``` +docker run --rm -it petstore +``` + + From f44bab305ce2df9a19b476adc027ca6e83507afc Mon Sep 17 00:00:00 2001 From: etherealjoy Date: Tue, 12 Jun 2018 14:56:40 +0200 Subject: [PATCH 4/4] Add {{{packageName}}} instead of petstore --- .../src/main/resources/go-server/README.mustache | 4 ++-- samples/server/petstore/go-api-server/go/README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/go-server/README.mustache b/modules/openapi-generator/src/main/resources/go-server/README.mustache index f982b6946c46..aedb0a341344 100644 --- a/modules/openapi-generator/src/main/resources/go-server/README.mustache +++ b/modules/openapi-generator/src/main/resources/go-server/README.mustache @@ -30,12 +30,12 @@ go run main.go To run the server in a docker container ``` -docker build --network=host -t petstore . +docker build --network=host -t {{{packageName}}} . ``` Once image is built use ``` -docker run --rm -it petstore +docker run --rm -it {{{packageName}}} ``` diff --git a/samples/server/petstore/go-api-server/go/README.md b/samples/server/petstore/go-api-server/go/README.md index c141a6deb3f0..30088c34683d 100644 --- a/samples/server/petstore/go-api-server/go/README.md +++ b/samples/server/petstore/go-api-server/go/README.md @@ -24,12 +24,12 @@ go run main.go To run the server in a docker container ``` -docker build --network=host -t petstore . +docker build --network=host -t petstoreserver . ``` Once image is built use ``` -docker run --rm -it petstore +docker run --rm -it petstoreserver ```