Skip to content

Instantly share code, notes, and snippets.

Last active Jan 14, 2021
What would you like to do?
amazon-ssm-agent Dockerfile
FROM golang:1.12-alpine as builder
ARG VERSION=2.3.930.0
RUN set -ex && apk add --no-cache make git gcc libc-dev curl bash && \
curl -sLO${VERSION}.tar.gz && \
mkdir -p /go/src/ && \
tar xzf ${VERSION}.tar.gz && \
mv amazon-ssm-agent-${VERSION} /go/src/ && \
cd /go/src/ && \
echo ${VERSION} > VERSION && \
gofmt -w agent && make checkstyle || ./Tools/bin/goimports -w agent && \
make build-linux
FROM alpine
RUN set -ex && apk add --no-cache sudo ca-certificates && \
adduser -D ssm-user && echo "ssm-user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/ssm-agent-users && \
mkdir -p /etc/amazon/ssm
COPY --from=builder /go/src/ /usr/bin
COPY --from=builder /go/src/ /etc/amazon/ssm/amazon-ssm-agent.json
COPY --from=builder /go/src/ /etc/amazon/ssm/seelog.xml
CMD ["/usr/bin/amazon-ssm-agent"]
Copy link

ipmb commented May 26, 2020

Copy link

wilhelm-murdoch commented Jun 3, 2020

Excellent! Thank you for this. I was close to writing something similar to get this running on Flatcar.

Copy link

elisboa commented Oct 18, 2020

Hi! Sorry for the dumb question, but do you have any suggestion on the way it should be run? I was thinking about mounting my $HOME/.aws, but appart from this I'm a bit clueless

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment